You are not logged in.
[Didn't find the right forum, please move it where it belong.]
I made a unit file type oneshot for my backup (with borgbackup) and everything works fine. The .timer file launch my service went I want, the backup are done and the service exit.
Now, I want to do something else after my backup are done and I was wondering if it's something possible with systemd.
AFAK, "After=foo.service" will make my service start when foo.service will be running, not when foo.service stopped. I'm I wrong?
Offline
wouldn't it be easier if you invoke "what shall be done" at the end of your backup script?
Offline
If your backup routine only returns after everything is done you could just use another execstart in your backup service file. If that is not an option you will have to provide more details.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
If your backup routine only returns after everything is done you could just use another execstart in your backup service file. If that is not an option you will have to provide more details.
So your saying that a unit with
ExecStart=foo.sh
ExecStart=bar.sh
bar.sh will be executed when foo.sh exited?
Not what I was planning but could do the job. Thanks!
Offline
So your saying that a unit with
ExecStart=foo.sh
ExecStart=bar.shbar.sh will be executed when foo.sh exited?
Yes.
There are other ways to do it, see 'man systemd.service' for what you can do with service files. Hint: you can trigger your bar.sh with a timer and make it require foo.sh but I guess that's a bit awkward since your "main" task is foo.sh.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline