Schedule a script as a job in GUI!

I would love if this was a feature in the Web Edition. To be able to execute a bash script or even other types of scripts from the GUI scheduled separately from other jobs. Is this planned to be added? I think there is a lot of potential in this! Thanks :slight_smile:

What would be the point of this? Every single OS already has a built in task scheduler/service manager.

If you want to have some work done before backup runs and cleanup after (such as taking and mounting a filesystem snapshot) Duplicacy CLI already supports pre- and post- task scripts.

Well it would allow for quick and easy to read execution paths. For example… if I set up a backup and a script setup to run before said backup using the current pre- and post- task scripts I would have to remember that I did that and in a team environment I would have to explain that to them as well. Alternatively if its already visible in the GUI its self-explanatory and easy to read/navigate

1 Like

Good point. I would surface the pre and post backup action in the schedule view. This needs to be done somewhere anyway — right now I don’t think there is a way to specify them without messing with implementation details and reading forums.

Does this mean it would be possible to integrate but difficult or not possible currently? Or perhaps I’m misunderstanding what you’re saying?

Ah sorry for the confusion, I meant that either in addition to, or instead of your suggestion it would be useful to have access to the pre/post scripts in the UI.

Since duplicacy CLI already supports them, surfacing them in the GUI should be pretty straightforward.

Adding standalone script execution will require more careful planning around concurrency/sequencing, handling script failures, etc.

Actually, both seem to be quite simple to add, but nobody saw the web gui source so that’s for gchen to decide.

1 Like

Cool! Makes sense… and I like that Idea… start with a feature that exposes the pre/post scripts in the GUI and later adding in a direct script execution. I don’t think it would be much harder than just a simple interface asking where to locate the script and then assigning a time to execute it… then when that time has passed… execute it… check for any thrown errors other than “error 0” and continue with other scheduled tasks if no other errors were detected. I would try to implement it myself but I don’t have the time to look into it at the moment. I guess for now I will use the pre/post… which I actually have a question about unrelated to this topic.

I have setup a Duplicacy instance using your docker image @saspus it worked great! However I’m wondering where I should put the pre-backup script. Any idea?

Duplicacy-web knows noting about them. It creates temporary repositories somewhere under /cache (in folders 0,1,2, etc for backup and “all” for prune I think, numbered in the order they appear in the UI) for duplicacy CLI to feel at home.

Consequently in each of them there would be .duplicacy sub folder, that contains a bunch of stuff — preferences file, filters file, logs, etc. The scripts folder should be created there and all the pre/post scripts place inside.

Super fragile. It will work until you add/remove backup jobs in the UI for the numbering to change.

1 Like

Thank you… this makes sense. 2 more quick questions…

  1. Can you make a pre/post prune script in every .duplicacy subfolder or can it only be used in the “all” folder

  2. I have read that if you are using Linux (I am in my case) that you should not use an extension such as .bat, does this mean that the bash script should only be named pre/post-prune and not pre/post-prune.sh? I am semi new with bash scripts so I’m curious as to why that was mentioned if it is in fact true.

  1. I think backup/check/ etc go to numbered folders but prune goes to all.
  2. Yes, no extensions. The script should contain path to interpreter after shebang. Depending on your script and interpreters available on your system you may want to explicitly choose one of sh/tsh/bash/zsh, etc. the script must be made executable (chmod +x pre-backup
1 Like