I am trying to set up a simple systemd timer to run a bash script every day at midnight.
systemctl --user status backup.service fails and the following is logged:
backup.service: Failed at step EXEC spawning /home/user/.scripts/backup.sh: No such file or directory. backup.service: Main process exited, code=exited, status=203/EXEC Failed to start backup. backup.service: Unit entered failed state. backup.service: Failed with result 'exit-code'.
I am lost since files and directories exist. The script is executable and, just for verification, I even set permissions for 777.
Some background:
The backup.timer and backup.service are located in /home/user/.config/systemd/user .
backup.timer loaded and active and is currently waiting for midnight.
Here's what it looks like:
[Unit] Description=Runs backup at 0000 [Timer] OnCalendar=daily Unit=backup.service [Install] WantedBy=multi-user.target
Here's backup.service :
[Unit] Description=backup [Service] Type=oneshot ExecStart=/home/user/.scripts/backup.sh [Install] WantedBy=multi-user.target
And finally, this is the paraphrase of backup.sh :
The script works fine if I executed it myself.
Not sure if that matters, but I'm using fish as my shell (launched from .bashrc).
I am happy to publish the full script if this is helpful.
source share