Is it possible start multiple jobs on '--on-success' or '--on-error'?
When running './xsibackup --menu' it says something like:
Set the --on-success and --on-error event to chain additional ...
- Job Id: 003, job1, ...
- Local script: /vmfs/volumes/datastore1/my_script.sh
- HTTP URL: https://...
'./xsibackup --menu' seems to allow it but does not accept a syntax like '003, job1'
I have a script 'myscript.sh' that just writes status to a another file. I tried this syntax but it does not work:
--on-success="backupId->myscript.sh, 00011" \
--on-error="backupId->myscript.sh, 0011" \
--exec=yes >> "/vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log"
But is it possible at all to set more than one job and what is the syntax?
By the way 'myscript.sh' is placed in '/vmfs/volumes/datastore1/xsi-dir/jobs' together with other jobs.
I have also tried to rename 'myscript.sh' to '0012' with no success:
This works but it but only fires one job obviously:
Backup jobs must be named 000 to 999, you may place any script placed in the jobs folder and call it from --on-success and --on-error.
That differentiation is only made so that you can trigger different things in each case, but if you just want to launch something in any case, then you can just write jobs one after another in the same job file.
Yes, I think know what you mean but I would not be able to setup such a job with './xsibackup --menu' as the GUI only looks at backup-id's individually. So I would need to setup such job file in cron manually?
But I would still like to know if I can do something like this:
--on-success="backupId->0012, 0011" \
--on-error="backupId->0012, 0011" \
, where job '0012' is a script and '0011' is a new backup job?
Job '0012' works fine and is just writing to a file:
echo "some text about the job that just finished" >> /to/some/file.txt
Last edited by malinux (2019-07-30 22:20:13)
No you cannot separate jobs by commas, you can't use four digits either, you must use job names 000 - 999
You can't combine scripts with the GUI, some advanced techniques like this will require you to edit the job files manually. It isn't a big deal in any case, just cut and paste jobs one after another or create your own scripts (remember 000-999) and invoke them as if they were jobs.