2

I have a script in a user folder that works successfully when run manually. But I cannot get it to work when run via the 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 the 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 have images of credit card receipts captured by my mobile using the Microsoft Office Lens app on Android. I'm using this script to move them from the cloud to my PC 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.

NotTheDr01ds
  • 22,082

1 Answers1

1

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.

cocomac
  • 3,824