What is the problem you are having with rclone?
I have wrritten a Script to Backup to GDrive using RClone and got a Service File to run just before Shutdown. While trying the systemctl start Backup2GDrive.service the rclone bacup finishes quickly but when I Shutdown the shutdown process freezes and runs for long time. Sometimes it finishes but sometimes it never finishes.
Run the command 'rclone version' and share the full output of the command.
rclone 1.60.1
- os/version: fedora 38 (64 bit)
- os/kernel: 6.3.6-200.fc38.x86_64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.3
- go/linking: dynamic
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
Google Drive
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone sync -P --fast-list --transfers 30 /home/user/Documents MyFedora_Documents: |
The rclone config contents with secrets removed.
[MyFedora_Documents]
type = drive
scope = drive
root_folder_id = [Intentionally Left Blank; It had a value]
token = [Intentionally Left Blank; It had a value]
team_drive =
client_id = [Intentionally Left Blank; It had a value]
client_secret = [Intentionally Left Blank; It had a value]
Script
#!/bin/bash
log=/home/user/Logs/GdriveBackup/GDriveBackup.txt
printf "Sync Start Time - " > $log
date >> $log
rclone sync -P --fast-list --transfers 30 /home/user/Documents MyFedora_Documents: |& tee -a $log
printf "Sync End Time - " >> $log
date >> $log
SystemD File
[Unit]
2 Description=RClone Shutdown Script
3 DefaultDependencies=no
4 Wants=network-online.target
5 After=network-online.target
6 Before=shutdown.target
7
8 [Service]
9 Type=oneshot
10 ExecStart=/home/user/Scripts/GDriveBackup.sh
11 RemainAfterExit=yes
12
13 [Install]
14 WantedBy=shutdown.target