Commit Graph

37 Commits

Author SHA1 Message Date
Kenneth Skovhede bb73f8f22e Don't pass script as argument to self 2024-06-17 09:54:08 +02:00
Kenneth Skovhede ca4fde938c Revert "Added option to use shell-execute with --run-script-use-document-open"
This reverts commit e32bba1dfc.
2024-06-17 09:47:09 +02:00
Kenneth Skovhede e32bba1dfc Added option to use shell-execute with --run-script-use-document-open 2024-06-17 09:39:17 +02:00
Kenneth Skovhede 1b7e1349ca Adding option for enabling argument parsing in scripts 2024-06-17 09:32:04 +02:00
Kenneth Skovhede 828ba240f3 Implemented simpler argument handling based on feedback 2024-06-13 07:40:09 +02:00
Kenneth Skovhede 486e13dd51 Revert "Added support for passing arguments to scripts"
This reverts commit 9b9e8a2adb.
2024-06-13 07:24:17 +02:00
Kenneth Skovhede 9b9e8a2adb Added support for passing arguments to scripts 2024-06-12 10:54:53 +02:00
Kenneth Skovhede 9f0810612a Changed logic for reporting exceptions, so all statistics are reported despite an exception stopping the backup 2024-04-02 22:31:55 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Skovhede 713b0b0746 Merge pull request #4417 from warwickmm/handle_unsupported_run_script_exit_codes
Abort with error if run-script-before script returns unsupported code
2021-03-06 14:12:33 +01:00
Kenneth Hsu 7d5b51482c Make DUPLICATI__PARSED_RESULT consistent with OperationAbortReason.
Previously, any exception, including OperationAbortExceptions thrown due
to run-script-before exit codes, would result in a Fatal parsed result.

This fixes #4222.
2021-01-14 19:38:55 -08:00
Kenneth Hsu 312c88e7e4 Abort with error if script exits with unsupported code.
This makes the code more consistent with the documentation in the
example scripts.
2021-01-10 10:44:58 -08:00
Kenneth Hsu 49e026ee92 Fix issue where remote URL defined using run-script-before was ignored.
Previously, we were declaring that the m_remoteurl field be passed by
reference to the Execute method.  However, the OnStart method declared
that the remoteurl variable was to be passed by reference.  As a result,
the caller (Controller.SetupCommonOptions) method never received the
updated value.

Now, the variables being passed by reference are made consistent.

This fixes #3651.
2020-11-01 13:13:54 -08:00
Kenneth Hsu 83ac03843d Fix spelling errors in comments.
In doing so, we also normalized some line endings.
2019-12-14 09:52:55 -08:00
Kenneth Hsu afab61a05b Use pattern matching to simplify casts. 2019-10-19 10:15:38 -07:00
Kenneth Skovhede 494fccd931 Added support for multiple exit codes, and added a unittest to verify that the exit codes are handled correctly 2018-08-14 11:09:16 +02:00
verhoek 07ae90f325 Simplified plus made defaults explicit. 2018-06-12 09:41:40 +02:00
Kenneth Skovhede de84650eae Rewrote the logic for reporting JSON to avoid reporting JSON inside a text blob, but instead use an extra tag in the JSON.
The logic is currently that the template is scanned for potential values, and those that are found are reported in the extra tag for the JSON.
A bit clumsy, but allows the user to choose specific fields to include in the reported data.
2018-04-12 11:46:54 +02:00
Kenneth Skovhede 4e5f4a12bf Merge branch 'master' into feature/filters-for-sendmail
Integrated changes to support log-lines and to have a common shared module for reporters

# Conflicts:
#	Duplicati/Library/Modules/Builtin/Duplicati.Library.Modules.Builtin.csproj
#	Duplicati/Library/Modules/Builtin/RunScript.cs
#	Duplicati/Library/Modules/Builtin/SendHttpMessage.cs
#	Duplicati/Library/Modules/Builtin/SendJabberMessage.cs
#	Duplicati/Library/Modules/Builtin/SendMail.cs
2018-04-12 11:16:57 +02:00
Stephen Gregory b7bda1d1c4 Add result serializers 2018-04-11 22:40:44 -02:30
Stephen Gregory 637e5a4a48 Change method signature of ResultSerializer 2018-04-11 22:40:43 -02:30
Stephen Gregory 46170de84e Extract result serialization to file 2018-04-11 22:40:42 -02:30
Kenneth Skovhede 731ecfc47d Rewrote the report modules to use a shared base class with all the non-sending specific code.
Change the logic for how the log data is included. It is now added as log lines _after_ the normal messages.
Added support for limiting the number of log lines sent.
Added support for setting the log levels on the modules.
Added support for setting a log filter on the modules.
Added support for sending log data as JSON from the http module.
2018-04-10 12:58:06 +02:00
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01:00
Kenneth Skovhede 36aadc4ad1 Merge pull request #2910 from warwickmm/refactor/remove_redundant_tostring
Remove redundant calls to ToString
2017-11-27 08:50:00 +01:00
Kenneth Hsu 5fb1958ceb Remove redundant calls to ToString. 2017-11-26 15:44:34 -08:00
Kenneth Hsu 8810e0130d Make string comparisons use ordinal (binary) sort rules.
These string comparisons should not be culture-aware.
2017-11-26 11:19:54 -08:00
Tyler Gill 83a1dcfb64 Replace all instances of InvariantCultureIgnoreCase with OrdinalIgnoreCase in string comparisons.
InvariantCulture is useful when comparing / sorting human language strings in a culturely correct way. It handles things like accented letters in a way that makes sense to humans (e.g., 'a' should be sorted next to 'á', rather than after 'z').
Ordinal looks just at the raw code points of the characters. As such, it is recommended for use in cases when comparing system strings (file paths, command line parameters, config settings, etc.). Since it doesn't need to use the culture specific sorting rules, this method can often be faster.

For more information, see https://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison (and other related questions)
2017-09-18 23:55:08 -06:00
Kenneth Skovhede d6aa87e003 Updated the run-script module to report the parsed result level.
This fixes #2656
2017-09-01 10:49:42 +02:00
Kenneth Skovhede a029890409 Implemented better default error messsages 2017-01-09 11:35:38 +01:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede d0090632c9 Fixed usage of EntryAssembly to work better with NUnit 2015-04-09 21:52:07 +02:00
Kenneth Skovhede 3149064cde Merge branch 'no_more_resx' 2015-01-20 21:45:54 +01:00
Kenneth Skovhede 8d13e698eb Updated copyright notices 2015-01-20 21:44:52 +01:00
Kenneth Skovhede 16c791f0b5 Removed all resx files, now using Duplicati.Library.Localization exclusively 2015-01-20 21:07:24 +01:00
Kenneth Skovhede 50825be1a2 Whitespace update and change to use the new print serializer 2013-05-22 21:35:18 +02:00
kenneth@hexad.dk a0521da54d Initial version of the new block-based storage format.
Still needs a work over in terms of error handling, progress reporting, warning output, refactoring etc.
Also misses the volume reuse/reclaim algorithms.
But it passes the unit tests now, with and without a local database.

git-svn-id: https://duplicati.googlecode.com/svn/sandboxes/Kenneth/ForestHash@1526 59da171f-624f-0410-aa54-27559c288bec
2013-02-12 21:43:14 +00:00