I know it's not an rclone problem, but I know several of us use Cron to automate our rclone jobs.
There's one particular job that just will not run from cron, even though it runs perfectly when executed manually.
My Cron Job: 30 * * * * /opt/rclone/scripts/gvault-move.sh
The Script:
#!/usr/bin/bash
if pidof -o %PPID -x "gvault-move.sh"; then
echo $(date "+%Y/%m/%d %H:%M:%S")" WARN : Cron attempted to start the move the local data mirror to vault: but the process is already running." >> /opt/rclone/logs/vault-upload.log
exit 1
fi
echo $(date "+%Y/%m/%d %H:%M:%S")" INFO : Cron started the rclone move subroutine" >> /opt/rclone/logs/vault-upload.log
# Move older local files to the cloud
rclone move \
/srv/dev-disk-by-label-Buffer/mirror/ vault: \
--log-level INFO \
--log-file /opt/rclone/logs/vault-upload.log \
--stats 0 \
--exclude-from /opt/rclone/exclude/gvault \
--drive-chunk-size 64M \
--delete-empty-src-dirs \
--user-agent gvaultapp \
--fast-list
And I've made the script executable with chmod +x /opt/rclone/scripts/gvault-move.sh
When I expect the script to run from cron, I get no output in the logs. Can anyone help me figure out why it wont run? Other scripts in the cronjob run just fine.
cron has no environment variables so it has no idea where rclone is.
You can use the full path in there and you can > somelog.txt in the cron job to see what it is doing. I'm guessing it's failing due to the path though.
Can you share the crontab -l as root? I want to make sure I test the same thing. I'm guessing it's something more OMV related but I've never used it before and wanted to see if I can replicate on a test server.
/bin/sh: /opt/rclone/scripts/gvault-move.sh: No such file or directory
Fixing both of those, it executes fine for me in a test VM. Doesn't seem anything specifically rclone related as it can't even call the script as it seems something more OSish, but I'm not sure what else offhand. I'll play around a little more and see if I have another idea.