Script location for sasplus docker

I couldn’t figure which is the correct locations for the scrips which can be run before / after the backup for the sasplus/duplicacy docker
I appreciate the help.

Did you mean https://hub.docker.com/r/saspus/duplicacy-web?

For the web UI, the repositories for the back jobs are located under ~/.duplicacy-web/repositories/localhost/<n> where n is the index of the backup job. So the pre/post scripts should be placed under ~/.duplicacy-web/repositories/localhost/<n>/.duplicacy/scripts.

Hey did you ever figure this out? I can’t figure out what directory to create a bind mount with. So far everything I have tried doesn’t work. Thanks

This response is pretty exhaustive: Script location for sasplus docker

Note, the ~/.duplicacy-web folder gchen is referring to is synlinked to /config in the container, which you are expected to map to the external docker volume

I would expect to see it in the log correct?

Running backup command from /cache/localhost/0 to back up /backuproot/dozzle
Options: [-log backup -storage test -stats]
2020-06-10 11:27:32.087 INFO REPOSITORY_SET Repository set to /backuproot/dozzle
2020-06-10 11:27:32.087 INFO STORAGE_SET Storage set to /test
2020-06-10 11:27:32.089 INFO BACKUP_START No previous backup found
2020-06-10 11:27:32.089 INFO BACKUP_INDEXING Indexing /backuproot/dozzle
2020-06-10 11:27:32.089 INFO SNAPSHOT_FILTER Parsing filter file /cache/localhost/0/.duplicacy/filters
2020-06-10 11:27:32.089 INFO SNAPSHOT_FILTER Loaded 0 include/exclude pattern(s)
2020-06-10 11:27:32.298 INFO UPLOAD_FILE Uploaded .env (25)
2020-06-10 11:27:32.298 INFO UPLOAD_FILE Uploaded docker-compose.yml (458)
2020-06-10 11:27:32.298 INFO BACKUP_END Backup for /backuproot/dozzle at revision 1 completed
2020-06-10 11:27:32.298 INFO BACKUP_STATS Files: 2 total, 483 bytes; 2 new, 483 bytes
2020-06-10 11:27:32.298 INFO BACKUP_STATS File chunks: 1 total, 483 bytes; 1 new, 483 bytes, 373 bytes uploaded
2020-06-10 11:27:32.298 INFO BACKUP_STATS Metadata chunks: 3 total, 445 bytes; 3 new, 445 bytes, 404 bytes uploaded
2020-06-10 11:27:32.298 INFO BACKUP_STATS All chunks: 4 total, 928 bytes; 4 new, 928 bytes, 777 bytes uploaded
2020-06-10 11:27:32.298 INFO BACKUP_STATS Total running time: 00:00:01

I added this to my docker-compose

$LMS/duplicacy/scripts:/.duplicacy-web/repositories/localhost/0/.duplicacy/scripts

If I browse to that location on the container I do see the script that I made which is just a simple hello world. Do the scripts not show in the logs?

also, my script is named pre-backup.sh and all it does is output the date to a text file. Which I cant seem to get to work.

Edit: One last thing. If I login to the console of the container and run the script directly it does indeed work.

Here you can see where I put the script. Is this correct? Still nothing in the logs. I have tried with and without the .sh extension as well.

The container defines the configuration variable "temporary_directory" : "/cache" in /config/settings.json; it does seem that if that is defined the folder the thing is running from is that location and therefore the you would want to place your scripts folder there.

I was finally able to make it work after a lot of hit and trial. The script needs to be in:
/mnt/user/appdata/Duplicacy/cache/localhost/1/.duplicacy/scripts

Also, the script name should be exactly ‘pre-backup’.

That is assuming:

  1. /config is mounted at /mnt/user/appdata
  2. “temporary_directory”: “/cache” in /config/settings.json

I tried using pre-backup.sh but it did not work. But then I noticed the file ‘preferences’ is an executable and do not have a file extension, so renamed my script to pre-backup and it worked