I know launchd is the way to go, but would really need to use cron in this situation.
I'm trying to run the following command through cron:
rclone copy /Users/x123/Downloads/torrents mega:torrents -q && rm -f /Users/x123/Downloads/torrents/*.*
This works ok on terminal, however when I go crontab -e
and add it, it doesn't run.
I also tried adding the command to an .sh script, making executable and running it with cron, also no good.
I'm honestly at loss. I tried touch
ing a file, and it works. For example:
*/5 * * * * touch ~/Downloads/torrents/Test1.txt
Creates the file just ok, however:
*/5 * * * * rclone copy /Users/x123/Downloads/torrents mega:torrents -q && rm -f /Users/x123/Downloads/torrents/*.*
Doesn't, neither does:
*/5 * * * * cd /Users/x123/ && ./script.sh
(which the script contains the command)
Worth noting: cron, crontab have Full Disk access.
Should I take this inquiry to rclone
forum? Any help understanding what's going on would be super appreciated!
So I learned a few things:
When working with
cron
and it seems to not work, check yourmail
inbox, it helps!Always use full paths when dealing with
cron
If you instruct
cron
a command, and then decide to move all this to a script, check and recheck your script. In my case, I was so wrapped up in full paths, that I forgot about the command verbs!Thank you all guys for the continuous and great support. It's extremely valuable!