Help with rclone and crontab

What is the problem you are having with rclone?

I am unable to schedule my backup. I've read several articles, but I couldn't find the problem with my command. Running manually, there is no problem. If anyone can help, I appreciate it.

What is your rclone version (output from rclone version)

rclone v1.52.2

  • os/arch: linux/arm
  • go version: go1.14.4

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu Server 16.04 Xenial Xerus 32 bit

Which cloud storage system are you using? (eg Google Drive)

Shared Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

The script is:

#!/bin/bash
if pidof -o %PPID -x "rclone-cron.sh"; then
exit 1
fi
/usr/bin/rclone copy gdteam-kdantas:"Arquivos TXT/" gdsmkn1:Backup/"Arquivos TXT/" --fast-list --progress --max-backlog=999999 --drive-acknowledge-abuse -vv --drive-server-side-across-configs --log-file=/home/kdantas/rclonecron.log
exit

And the crontab schedule is:

00 03 * * * /home/kdantas/rclone-cron.sh >/dev/null 2>&1

What's in the log file?

/home/kdantas/rclonecron.log

kdantas@ns3767732:~$ ./rclone-cron.sh
Transferred: 215.658k / 215.658 kBytes, 100%, 9.908 kBytes/s, ETA 0s
Transferred: 41 / 41, 100%
Elapsed time: 21.7s

kdantas@ns3767732:~$ cat rclonecron.log
2020/07/20 17:41:47 DEBUG : rclone: Version "v1.52.2" starting with parameters ["/usr/bin/rclone" "copy" "gdteam-kdantas:Arquivos TXT/" "gdsmkn1:Backup/Arquivos TXT/" "--fast-list" "--progress" "--max-backlog=999999" "--drive-acknowledge-abuse" "-vv" "--drive-server-side-across-configs" "--log-file=/home/kdantas/rclonecron.log"]
2020/07/20 17:41:47 DEBUG : Using config file from "/home/kdantas/.config/rclone/rclone.conf"
2020/07/20 17:41:48 DEBUG : fs cache: renaming cache item "gdteam-kdantas:Arquivos TXT/" to be canonical "gdteam-kdantas:Arquivos TXT"
2020/07/20 17:41:49 DEBUG : fs cache: renaming cache item "gdsmkn1:Backup/Arquivos TXT/" to be canonical "gdsmkn1:Backup/Arquivos TXT"
2020/07/20 17:41:50 DEBUG : Google drive root 'Backup/Arquivos TXT': Waiting for checks to finish
2020/07/20 17:41:50 DEBUG : Google drive root 'Backup/Arquivos TXT': Waiting for transfers to finish
2020/07/20 17:41:52 DEBUG : 5.Centimeters.Per.Second.txt: MD5 = 8521420872cc951aaab5babf7bf7a0da OK
2020/07/20 17:41:52 INFO : 5.Centimeters.Per.Second.txt: Copied (server side copy)
2020/07/20 17:41:52 DEBUG : Adele_-_Live_From_The_Artists_Den_2012.txt: MD5 = b677505f4b75992d183ca85dc0dd9c74 OK
.
.
.
2020/07/20 17:42:10 DEBUG : log-file.txt: MD5 = d41d8cd98f00b204e9800998ecf8427e OK
2020/07/20 17:42:10 INFO : log-file.txt: Copied (server side copy)
2020/07/20 17:42:11 DEBUG : meta2magnet.txt: MD5 = 48733c6c1f0a4303033571ecda54c5a9 OK
2020/07/20 17:42:11 INFO : meta2magnet.txt: Copied (server side copy)
2020/07/20 17:42:11 DEBUG : 吸血鬼日记.第二季.txt: MD5 = 947c535eb57653ea31efa45af41a511d OK
2020/07/20 17:42:11 INFO : 吸血鬼日记.第二季.txt: Copied (server side copy)
2020/07/20 17:42:11 INFO :
Transferred: 215.658k / 215.658 kBytes, 100%, 9.908 kBytes/s, ETA 0s
Transferred: 41 / 41, 100%
Elapsed time: 21.7s

2020/07/20 17:42:11 DEBUG : 14 go routines active

I found out why I wasn't seeing the cron run. When doing the crontab tests, I was using my local time and not the system time. What would be the command to run rclone inside a screen? And how to see the execution of the command crontab (cmd screen)?

I mean, when it runs from cron, what's the logfile look like? We can figure out what the error is from the logfile when it runs via cron.

Now it´s ok. I was a silly mistake. My question now is: What would be the command to run rclone inside a screen? And how to see the execution of the command crontab (cmd screen)?

Cron runs in the background so you are not going to be able to see it.

You can just set it to run in a few minute or two and share the output.

Thanks Animosity022, problem solved.

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