I have recently migrated to Linux (Arch with KDE). I have created a couple of cronjobs for rclone 'copy'.
Most of the time, I might have to reboot or shut down the system and during these times, the rclone service takes a long time to stop. The following line(s) show up during shutdown or reboot:
"...waiting for rclone(pid).."
What I want is that the rclone service should stop as soon as the system sends a shutdown or reboot signal or not take too much time (current case - it takes more than 2 minutes, which is not normal).
Can I have guidance on the issue? Should I add some entries to the cron .sh files or the crontab -e list?
Any help is appreciated.
Run the command 'rclone version' and share the full output of the command.
rclone v1.62.2
os/version: arch "rolling" (64 bit)
os/kernel: 6.3.5-zen2-1-zen (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.20.4
go/linking: dynamic
go/tags: none
Which cloud storage system are you using? (eg Google Drive)
onedrive
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Thanks for the reply. There are no errors.
In fact, the corn job runs smoothly. I only need the rclone service to stop immediately on shutdown and reboot.
This seems innovative. Considering that I am new to Linux, can you provide help on how to move the rclone jobs from crontab to systemd and, at the same time, conserve the crontab functionality (to run every two hours/every day/week or run during boot and so on).
Thanks for this. I have set everything up in Linux until now without creating a single forum post. I always try to do everything myself and come here only when I am stuck
check if kill is in this path /bin/kill. It should be but could be in /sbin instead... I am not sure it is the same for all systems.
Also maybe to make it looking nicer:
ExecStop=/bin/kill -s SIGKILL $MAINPID
One thing I would do is to test as well with:
ExecStop=/bin/kill -s SIGTERM $MAINPID
SIGKILL is non-catchable, non-ignorable kill when SIGTERM is software termination signal. If system shutdown works with SIGTERM there is no need to use SIGKILL
Other thing is that if running your rclone job using systemd does not delay shutdown/reboot there might be not need at all to send termination signal on Stop... If things work without maybe it is enough.