What is the problem you are having with rclone?
rclone itself is running, but I can't get it to run in a cron job as root user.
What is your rclone version (output from rclone version
)
rclone v1.57.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-91-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- go/linking: static
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
pcloud
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
I have a VM running under Proxmox on Ubuntu Server 20.04.3. A USB hard disk (NTFS) is mounted there. Thus the owner is always root:root. When I execute the command below on the shell, everything runs as I want, i.e. files and folders are "backed up" from the pcloud to the local USB hard drive.
/usr/bin/rclone sync 'pcloud:' '/mnt/usb/BackupPCloud/' --progress --create-empty-src-dirs --config="/root/.config/rclone/rclone.conf"
The rclone config contents with secrets removed.
Here are the contents of /root/.config/rclone/rclone.conf
[pcloud]
type = pcloud
token = {"access_token":"here is my token","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
hostname = eapi.pcloud.com
Here my cron job:
1.) sudo su -
2.) password
3.) crontab -e
*/5 * * * * /usr/bin/rclone sync 'pcloud:' '/mnt/usb/BackupPCloud/' --progress --create-empty-src-dirs --config="/root/.config/rclone/rclone.conf"
It should run every 5 minutes until the cronjob finally runs. If I could then see the process "rclone" in a second shell via "top" or read out the logfile via tail, I would know that the cron job is running.
But it simply does not do that
I have also tried to call the command as a cron job with "root", also without success.
*/5 * * * * root /usr/bin/rclone sync 'pcloud:' '/mnt/usb/BackupPCloud/' --progress --create-empty-src-dirs --config="/root/.config/rclone/rclone.conf"
I would actually like to achieve the following. At night at 01:00 rclone should start the backup job to the USB hard disk. Since I am only connected to the internet with LTE, the job takes up all my bandwidth. In the morning at 06:00, a "killall rclone" should also end rclone via cron job. In this way, I make a little progress every day.
Thanks for your help
Greetings H-BLOGX