Hi!
I’m a new user of Duplicati; I start use this software same months ago and continue to use it! In these months I encountered some problems (very well know), anyway I belive in this project but unfortunately in Italy this software isn’t very well known.
Now, this is my problem: I wish backup the local database so if my HDD suddenly death I should be able to recovery my data without waiting hours or days to recreate the whole databases from scratch. I create a batch file and use the --run-script-after option to launch it when the backup has finished. In the script I launch duplicati client to schedule the backup of databases when the last backup job finish successifully. Unfortunately the backup finish correctly but it exit with a warning says “Esecuzione dello script ” fuori tempo" (in english) “Execution of the script out of time”.
Of course if I run the script from cmd.exe it works fine. If I use the option --run-script-timeout I obtain the same result. If I use this dummy script I obtain the same result
Blockquote @echo off
if /i “%DUPLICATI__OPERATIONNAME%” neq “Backup” goto end
if /i “%DUPLICATI__PARSED_RESULT%” neq “Success” goto end
c:\Windows\System32\notepad.exe
:end
exit 0
If I replace notepad.exe with a echo It works correctly. Can anyone help me?
In your dummy script you are running notepad.exe. This will pause the script until notepad.exe is closed, leading to the timeout error.
In your real script you aren’t running notepad.exe, but what command are you running? Can you share your real script? (Remove sensitive information if present…)
mmh sorry -.-’ the heat comes to my head. Of course the blockquete is a mistake because I’m not practiced with the editor of this site. If I launch the script from cmd.exe it work’s fine without error code.
Probably because the DUPLICATI__ environment variables are not present when you manually run it from cmd.exe – they only exist when the script is launched by Duplicati. So when you test it from cmd.exe, it ends up doing that goto end and exits right away.
Try temporarily removing those two if lines at the top and then run it from cmd.exe.
No because if I delete the first and second lines or declare the environment variables and next launch the script all works correctly. It couldn’t be a problem of “database lock” because I try to launch the script (from command line) when a backup task is still in progress and even in this case all work correctly: first the backup finish and next start the backup of “metadata”.
I write a simple C program who create a text file and if I launch a batch file with this command; The result is no error and the backup jobs works. Next step: try your code! and log the activity.
DUPLICATI__allow_sleep=false
DUPLICATI__backup_name=backup di prova
DUPLICATI__blocksize=102400b
DUPLICATI__block_hash_algorithm=SHA256
DUPLICATI__compression_module=zip
DUPLICATI__dblock_size=50mb
DUPLICATI__dbpath= CORRECT_PATH
DUPLICATI__disable_module=console-password-input
DUPLICATI__encryption_module=
DUPLICATI__EVENTNAME=AFTER
DUPLICATI__file_hash_algorithm=SHA256
DUPLICATI__LOCALPATH=D:\duplicati_aux
DUPLICATI__main_action=Backup
DUPLICATI__no_encryption=true
DUPLICATI__OPERATIONNAME=Backup
DUPLICATI__PARSED_RESULT=Success
DUPLICATI__REMOTEURL=file://D:\backup_di_prova
DUPLICATI__RESULTFILE=C:\WINDOWS\TEMP\dup-a78e93d6-46aa-46cd-bcf6-bc35eaf9bfad
DUPLICATI__run_script_after=D:\duplicati_aux\backup_database.bat
DUPLICATI__send_mail_any_operation=true
DUPLICATI__send_mail_from=sensible data
DUPLICATI__send_mail_password=sensible data
DUPLICATI__send_mail_subject=Duplicati %PARSEDRESULT%, %OPERATIONNAME% report for %backup-name%
DUPLICATI__send_mail_to=sensible data
DUPLICATI__send_mail_url=sensible data
DUPLICATI__send_mail_username=sensible data
DUPLICATI__throttle_download=
DUPLICATI__throttle_upload=
DUPLICATI__use_block_cache=true
for the log file instead I obtain a strange result: The file is correctly created but the dimension is 0KB and is empty. The only way to read the file is stop the service… but it shouldn’t be correct anyway the log is:
The request timed out. Is the server running?
Not logged in
Logging out…
of course the server is running . In addition I notice that since I had installed the software in the log there are many errors related to assembly that can’t be loaded (it’s related to microsoft windowsazure) It could be a broken installation of the .NET Framework?
Yes I run Duplicati as Service (I’m apologyze, I took it for granted, but I must specify this). I search in the forum in the last days but I don’t found never related this… but this bug is reported yesterday… ok, this isn’t a problem for me. I wait a new release of duplicati client (or duplicati ?) and retry my experiments.
Do we know that duplicati-client.exe can ever do backups in a --run-script-after (service or not-service)?
There are things that happen after the backup itself, such as sending job report and presumably scripts.
Duplicati seemingly won’t schedule next job until these are finished, e.g. if script waits, so does next job.
Test used a 300 second timeout. Status bar said backup was complete, yet GUI run of next job waited…
Duplicati client is (I think) just a lower-level interface into scheduling so post-backup DB backup may be waiting for itself to complete before it can launch DB backup job. Such deadlock won’t occur externally, explaining why script can run externally. In that case, backup has no run-after work, so can back up DB.
If this is the problem, a solution might be to export GUI job to backup DB, then just run that in the .bat file. Such command line work runs independently from jobs that run in the server, so you get no GUI results.
@ts678 Just to clarify: you suggest to create a script containing only the start command and launch this script with --run-script-after. The start command run my real backup database script. Correct?