PDi
June 23, 2024, 4:21pm
1
Set up:
docker container linuxserver/duplicati running on Debian GNU/Linux 12 (Raspberry Pi) as root (PUID 0, GUID 0)
Mount a host volume for scrips
Create a new tiny backup job
Add the option “run-script-before-required” pointing to a script on the host
Add email notification options (global section)
Test 1:
Let the script return zero
Result:
Success, respective email sent
Test 2:
Let the script return non-zero
Result:
Backup job fails as expected with respected notification in the logs
No email sent
Expected result:
Whenever a mandatory script fails, an appropriate email should be sent
This looks like it is to do with the module loading order. The run script module throws a OperationAbortException
to stop the backup from running. This is handled correctly and all the OnFinish
methods are called, but because the mail module was not configured before, it does nothing. The proper way to fix this would probably be to configure all modules before calling OnStart
.
foreach (var mx in LoadedModules)
if (mx.Key)
{
if (mx.Value is Library.Interface.IConnectionModule)
mx.Value.Configure(conopts);
else
mx.Value.Configure(m_options.RawOptions);
if (mx.Value is IGenericSourceModule sourcemodule)
{
if (sourcemodule.ContainFilesForBackup(paths))
{
var sourceoptions = sourcemodule.ParseSourcePaths(ref paths, ref pristinefilter, m_options.RawOptions);
foreach (var sourceoption in sourceoptions)
m_options.RawOptions[sourceoption.Key] = sourceoption.Value;
}
}
if (mx.Value is IGenericCallbackModule module)
This file has been truncated. show original
I have made a PR that fixes this.