Rclone works but not from cron (raspberry pi)

Final word

I just set up a new headless Raspberry Pi zero with rclone and it works 100%.

pi@zero:~ $ sudo apt install rclone
pi@zero:~ $ rclone config

I ran through the setup for connecting to Google Drive.
Then I set the rclone.conf permissions like this...

pi@zero:~ $ cd /home/pi/.config/rclone
pi@zero:~/.config/rclone $ sudo chown pi:pi rclone.conf
pi@zero:~/.config/rclone $ sudo chmod 644 rclone.conf
pi@zero:~/.config/rclone $ ls -la
total 12
drwxr-xr-x 2 pi   pi 4096 Nov  6 12:26 .
drwxr-xr-x 3 pi   pi 4096 Nov  2 13:37 ..
-rw-r--r-- 1 pi   pi  434 Nov  6 23:04 rclone.conf

Then I made a bash script called google.sh stored at /home/pi/* but it could be anywhere...

#!/bin/bash
if pidof -o %PPID -x "google.sh"; then
exit 1
fi
# cron calls this to move files from local/source to cloud:destination
rclone move /home/pi/files/ Google:/rpi/
exit

I made it executable

pi@zero:~ $ sudo chmod a+x /home/pi/google.sh

I put test files into /home/pi/files and ran the google.sh script

pi@zero:~ $ /home/pi/google.sh

It worked.
Then I made a quick python script named 'call.py'

#!/usr/bin/python
import subprocess
subprocess.call(['sh','/home/pi/google.sh'])

It calls the 'google.sh' script. I ran it...

pi@zero:~ $ python call.py

It worked.
Then I entered crontab like this...

pi@zero:~ $ crontab -e

And I pasted the following command in there.

# auto backup /home/pi/files/ to Google:/rpi/
*/1 * * * * /home/pi/google.sh >/dev/null 2>&1

I put some more test files in /home/pi/files/ and after a minute they moved up to the Google Drive.

That's it. It works. It's replicatable. I can cloud connect my IoT projects. I hope this helps someone. Thanks.