How to easily restore from --backup-dir to original location

What is the problem you are having with rclone?

Not really a problem but rather trying to find an improvement for the way I've currently configured rclone. I'm not really looking to have a new feature developed unless this is asked by other people as well. Just tying to find out if i can use rclone in a better way for my situation.

Currently i use a sync command with --backup-dir to move deleted content to an archive directory.
Sometimes i download content from that backup-dir.
I use --include-from with a file containing all of the filenames (not directories) downloaded that need to be moved back to their previous location where the sync command will pick them again.

I've tried using --copy-dest but it seems not to work for me. Maybe I'm doing something wrong but i could not find any example implementations for this one. Maybe it did not work because the files match based on path and filename and the downloaded files from backup-dir were no longer in there original folder.

I'm basically looking at two different ways to improve this situation. (see further below for the commands used)

  1. --include-from is fed from a directory listing instead of the contents of a file. This would save time as i do not have to manually fill a text file with the necessary filenames. This requires me to put the downloaded files from the backup-dir in a specific folder and rclone will restore them from the backup-dir
  2. A parameter for sync where i can tell it to check whether it can find any files to be uploaded in the previously mentioned backup-dir and move them back if necessary (tried doing this with --copy-dest)

Does anybody have an idea that would help with the above 2 scenarios?

Run the command 'rclone version' and share the full output of the command.

rclone v1.57.0

  • os/version: Microsoft Windows 10 Pro 2009 (64 bit)
  • os/kernel: 10.0.19044.1586 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: dynamic
  • go/tags: cmount

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)

Base sync command

C:\rclone\rclone.exe sync --bwlimit 3M:off --fast-list --track-renames --track-renames-strategy modtime --check-first --delete-after --delete-excluded --exclude-from "C:/rclone/Configs/Exclusions.txt" --backup-dir cryptGDrive:Archive/Union --progress --log-file "C:\Users\name\Desktop\MirrorD Log\Rclone Mirror_Union.log" --log-level INFO local:E:/Union/ cryptGDrive:Union

Command to restore files from the backup-dir

C:\rclone\rclone.exe move --fast-list --check-first --include-from "C:/rclone/Configs/BackupSync_filelist.txt" --progress --log-file "C:\Users\name\Desktop\MirrorD Log\Rclone BackupSync.log" --log-level INFO cryptGDrive:Archive/Union cryptGDrive:Union

The rclone config contents with secrets removed.

[local]
type = local
encoding = Slash,InvalidUtf8
copy_links = true

[remoteGDrive]
type = drive
client_id = 
client_secret = 
scope = drive
root_folder_id = 
service_account_file = 
token = 
encoding = Slash,InvalidUtf8
pacer_min_sleep = 10ms
pacer_burst = 1000

[cryptGDrive]
type = crypt
remote = remoteGDrive:Crypt
filename_encryption = standard
directory_name_encryption = true
password = 
password2 = 

A log from the command with the -vv flag

n/a
Sorry don't what log you would want if i'm asking what commands to use to get something done.
If a log would help please let me know of what situation described above (or other situation) you would like me to provide

Maybe I am missing something but can't you just use copy (not sync) on the directory? Something like:

rclone copy remote:backups/<date>/subdir remote:full/subdir

I only want to restore a subset of files (around 10 out of 10000 files). Those files are spread among several directories. Thats why i used --include-from. It uses a text files only containing filenames. It will find those files and move them back to there respective folder before --backup-dir moved them

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