I am starting to use rclone and it's really amzing. But, I can only run the jobs manually. Through cronjobs it's not working, and I can see they return an error, as below:
2023/01/27 15:30:01 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
2023/01/27 15:30:01 Failed to create file system for "Mega_Rclone:Backups_via_rclone/games/saves/no_mans_sky": didn't find section in config file
Well, OK, that's a save game just to start the tests.
Run the command 'rclone version' and share the full output of the command.
cron runs as root, but crontabs are user based and you can have any user run cron jobs as they are per user.
Is that root's crontab as @asdffdsa was suggesting or another user?
cron jobs also generally have no environment variables and no concept of paths so putting 'rclone' won't work.
So my old upload script looked like:
[felix@gemini ~]$ cat /opt/homescripts/scripts/upload_cloud
# RClone Config file
RCLONE_CONFIG=/opt/rclone/rclone.conf; export RCLONE_CONFIG
# Local Drive - This must be a local mount point on your server that is used for the source of files
# WARNING: If you make this your rclone Google Drive mount, it will create a move loop
# and DELETE YOUR FILES!
# Make sure to set this to the local path you are moving from!!
# Exit if running
if [[ $(pidof -x "$(basename "$0")" -o %PPID) ]]; then
echo "Already running, exiting..."; exit 1; fi
# Is $LOCAL actually a local disk?
if /bin/findmnt $LOCAL -o FSTYPE -n | grep fuse; then
echo "FUSE file system found, exiting..."; exit 1; fi
# Rather than use excludes, I wanted to simplify and just have two move commands to move to Movies and TV Shows
# Adjust a few settings to stay within the Dropbox API limits
# Move to Movies Folder
/usr/bin/rclone move $LOCAL/Movies upload-movies:Movies --log-file /opt/rclone/logs/upload.log --delete-empty-src-dirs --fast-list --dropbox-chunk-size 128M --tpslimit 12 --tpslimit-burst 12 --transfers 6 --stats-one-line -v --min-age 1h
# Move to TV Folder
/usr/bin/rclone move $LOCAL/TV upload-tv:TV --log-file /opt/rclone/logs/upload.log --delete-empty-src-dirs --fast-list --dropbox-chunk-size 128M --tpslimit 12 --tpslimit-burst 12 --transfers 6 --stats-one-line -v --min-age 1h