In an attempt to automate my backups using a batch script, I’m considering the usage of the Duplicati environment variables so I wrote the following batch script (Windows):
echo Init global environment variables
set PASSPHRASE=...
set TARGET_BASE=Z:\oracle
set DUPLICATI_EXE=D:\app\duplicati\Duplicati.CommandLine.exe
set BACKUP_NAME=app_adb
set SOURCE_DIR=D:\app\adb
echo Init DUPLICATI__ environment variables
set DUPLICATI__auto_cleanup=true
set DUPLICATI__auto_update=false
set DUPLICATI__auto_vacuum=true
set DUPLICATI__backup_name=%BACKUP_NAME%
set DUPLICATI__blocksize=200KB
set DUPLICATI__compression_extension_file=D:\app\duplicati\default_compressed_extensions.txt
set DUPLICATI__compression_module=zip
set DUPLICATI__console_log_level=Information
set DUPLICATI__dblock_size=256MB
set DUPLICATI__dbpath=D:\app\duplicati\local_db\%BACKUP_NAME%_db.sqlite
set DUPLICATI__disable_module=console-password-input
set DUPLICATI__encryption_module=aes
set DUPLICATI__exclude_empty_folders=false
set DUPLICATI__full_result=true
set DUPLICATI__log_file=%TARGET_BASE%\logs\duplicati-%BACKUP_NAME%.log
set DUPLICATI__log_file_log_level=Information
set DUPLICATI__log_retention=1095D
set DUPLICATI__prefix=%BACKUP_NAME%
set DUPLICATI__retention_policy="2W:U,4W:1D,6M:1W,U:1M"
set DUPLICATI__tempdir=D:\app\duplicati\temp
set DUPLICATI__thread_priority=belownormal
set DUPLICATI__use_background_io_priority=true
set DUPLICATI__use_block_cache=true
echo Calling Duplicati
echo --
%DUPLICATI_EXE% backup "file://%TARGET_BASE%\%BACKUP_NAME%\\" "%SOURCE_DIR%"
echo --
echo Backup created
As intended, I replaced all ‘-’ by underscored in the argument names yet it still appears that Duplicati is ignoring them all together. Even the DUPLICATI__dbpath does not seem to be used.
Is this suppose to work this way or did I misunderstood how these env variables can work?