Trouble executing rclone in crontab


I tried to set a crontab with rclone copy but it seems it's not executing and there is no log output.
I try a lot of things but nothing seems to work.

rclone v1.54.1
Ubuntu 20.04
GoogleDrive storage

The cron is fine, my script is running but the line with rclone do nothing, there is also no log file created.
When I run the script without cron, it works perfectly.

Here is my script :


if pidof -o %PPID -x “$0”; then
        exit 1

cd ~ || exit

# RClone Config file

title="save-$(date +'%Y-%m-%d').tar.gz"

tar -czvf "$title" /myDirectory
/usr/bin/rclone copy "$title" gdrive:/test --log-file /home/ubuntu/rclone.log -vv
rm "$title"

Thanks in advance.

Try removing that test. It might be false-triggering because of how cron fires up jobs.

Thanks for your reply.

So, I came back on my drive and the file was there xD
I didn't remove the cron and it seems it was working from the beggining.

The test in my script wasn't the issue.
As I said, my cron was executing my script fine.
I could see in the log the tar being made.
It's just the rclone command that logs nothing and seems to don't work as my file wasn't transferred.

I suspect it's the way of rclone not transferring unchanged files that makes me believe it was not working.

As I removed the file in my gDrive and remade a new tar every time I tested the script, I thought the file will be considered as a new one.
It's curious that the rclone wasn't making a log file with something like 'already transferred, doing nothing' though
But yesterday, it was transfered at the last hour I put in my crontab to do my tests.

I will try to make a change to the directory being compressed before triggering the cron to be sure.

Anyway, thanks for your time.
Have a good day.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.