Rclone sync to google Drive

Hello all!

I somehow cant figure out how to autmate Rclone syncing to Google drive and after transferring the file delete the local file. Can you guys help me out?

I got the following codes:

How should I change these codes to get cronjob and Rclone working? When I put the code manually in (from the crontab -e), then it works (without the file deletion).

If you want rclone to delete the local files, you need to use move instead of sync. --delete-after will delete the files from the destination assuming they no longer exist on the source either. The purpose of sync is to mirror origin to destination.

Thanks,

I will replace sync with move.

Do you also happen to know whats wrong with the code? Why its not working.

Can you clarify your problem a bit? If I’m understanding this right, you can’t get crontab to work, but it works fine when you the command directly?

Yes, thats right. I originally thought I made a mistake with the paths, but I think I got those right?

I think the path in your second screenshot. Unless it’s supposed to be hidden, it shouldn’t have a period.

Currently you have:

/media/adfb/golfboy/.cronscript.sh

But based on the other screenshot above I think it should be:

/media/adfb/golfboy/cronscript.sh

I changed both scripts to cronscript.sh instead of .cronscript.sh So it matches eachother again. Unfortunately its not working.

Do I have to do something special after I entered the scripts? Maybe i have to leave the computer on for hours or have to enable is somewhere?

Stick >> /tmp/rclone.log 2>&1 on the end of the crontab line, then look in /tmp/rclone.log to see what errors you are getting.

Its working! I had to add bin/rclone move (the bin/ part). Then it worked great! Thanks all

When working with cron, always use full paths and when the target is a script invoke the shell passwing the parameter and not the script.

/home/me/myscript.sh parameter
to
/bin/sh /home/me/myscript.sh parameter

On some systems the first version may work. On others it may fail. The shell command may vary depending on your script language.

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