New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--REMOTEURL ignored in --run-script-before script #3651

Open
kees-z opened this Issue Feb 7, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@kees-z
Copy link

kees-z commented Feb 7, 2019

  • I have searched open and closed issues for duplicates.

Environment info

  • Duplicati version: 2.0.4.15
  • Operating system: Windows 10 Pro
  • Backend: N/A

Description

According to the example script (line 106-108), the remote location can be dynamically set using a script before the operation starts by echoing --remoteurl=<url-of-backend>. This should replace the backend settings that are configured in the backup job with the value being echoed.
This seems to work for most options, but the documented --remoteurl is ignored.

Changing the configured backend settings can be very useful, for example to connect to a backup location that's in the local network (NAS). If a laptop with Duplicati installed is at an external location, the script could detect if the backup location can be reached. If not, the remote location could be changed to another protocol and/or URL (for example file://N:\NAS\Backup to ftp://x.x.x.x/Backup).

Steps to reproduce

  1. Create a batchfile containing this:
@echo off
echo --dblock-size=25mb
echo --remoteurl="file://C:\Folder2"
  1. Configure a backup job, targeting to C:\Folder1.
  2. Add --run-script-before to the backup job to call the batchfile in step 1
  3. Run the backup.
  • Actual result:
    Backup files are stored in C:\Folder1 (as configured in the backup job)
  • Expected result:
    Backup files are stored in C:\Folder2 (--remoteurl should replace the configured location to C:\Folder2)

The script is actually executed before the operation starts, because 25MB DBLOCK files are created, instead of the default 50MB. The --remoteurl is recognized (other attempts like remote-url result in ending the backup with a warning "The supplied option is not supported and will be ignored), but the backup location doesn't change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment