I have a script in a USER folder that works successfully when run manually. But I cannot get it to work when run via USER CRON (edited via crontab -e).
There are web posts elsewhere by others who have the same problem but I do not understand the discussions well enough to implement a solution.
I originally had RCLONE installed via SNAP on Bionic 18.04 but suspected that SNAP could be the problem. I have removed the SNAP version and reinstalled via SYNAPTIC.
My credentials for the remote on Microsoft ONEDRIVE are held in
/home/USER/.config/rclone/rclone.conf
I simplified my script into a test with a pipe to see output: >> test.log and my test log got created but was empty so I cannot see what is going on. My simplified test script is:
rclone move onedriveUSER:Pictures "/home/USER/Documents/PATH" >> test.log
I am not sure if the pipe is the right approach to debug. I'm new to this.
I'm using this script to move to my PC from the cloud pics of credit card receipts captured by my mobile using the Microsoft Office Lens app on Android. I'm really pleased with the process that allows me to throw away all my paper receipts each day.
But I want to automate the process on my Ubuntu desktop pc with CRON.
I found the fix here.
Turns out that for cron to work with the script the full path to rclone is required. So changing:
rclone to /usr/bin/rclone
In my script works fine.