barrowcroft
New Member
I have a bash script that user rsync to incrementally backup my home dir to an external usb drive mounted via fstab.
I have a service to run the script as follows:
With a timer as follows:
The whole thing works well. The backups run and completes within a matter of seconds.
However, the next day, the first time the back up should run, the journal gives me:
Which seems to imply the script is already in use, but i know it completed successfully.
Could anyone tell me what I am missing.
many thanks
I have a service to run the script as follows:
[Unit]
Description=backup service
[Service]
ExecStart=systemd-inhibit --what=idle:sleep:shutdown --who="Backup Service" --why="Running backup service"--mode=block /usr/local/bin/backup.sh
With a timer as follows:
[Unit]
Description=backup timer
[Timer]
OnCalendar=--* 06:00:00
OnCalendar=--* 07:00:00
OnCalendar=--* 08:00:00
OnCalendar=--* 09:00:00
OnCalendar=--* 10:00:00
OnCalendar=--* 11:00:00
OnCalendar=--* 12:00:00
OnCalendar=--* 13:00:00
OnCalendar=--* 14:00:00
OnCalendar=--* 15:00:00
OnCalendar=--* 16:00:00
OnCalendar=--* 17:00:00
OnCalendar=--* 18:00:00
OnCalendar=--* 19:00:00
OnCalendar=--* 20:00:00
OnCalendar=--* 21:00:00
OnCalendar=--* 22:00:00
Persistent=true
WakeSystem=true
[Install]
WantedBy=timers.target
The whole thing works well. The backups run and completes within a matter of seconds.
However, the next day, the first time the back up should run, the journal gives me:
Jan 19 06:00:29 pop-os systemd[1]: Started backup service.
Jan 19 06:00:29 pop-os systemd-inhibit[57950]: Failed to inhibit: The operation inhibition has been requested for is already running
Jan 19 06:00:29 pop-os systemd[1]: backup.service: Main process exited, code=exited, status=1/FAILURE
Jan 19 06:00:29 pop-os systemd[1]: backup.service: Failed with result 'exit-code'.
Which seems to imply the script is already in use, but i know it completed successfully.
Could anyone tell me what I am missing.
many thanks