Backup-dir not working as intended

I am trying to create incremental backups using rclone. For that purpose I am using --backup-dir. But rclone only syncs the file in the sink and not in the directory specified in backup-dir.

rclone v1.56.2

rclone local filesystem remote to local filesystem remote

NOW=$(date  +"%Y-%m-%dT%H%M%S")
SRC=remote:
DST=backup:weekly
BCK=backup:daily/`date  +"%Y-%m-%dT%H%M%S"`

rclone sync --no-update-modtime  --log-level DEBUG $SRC $DST --backup-dir $BCK
[test]
type = local

[backup]
type = alias
remote = test:/home/shivam/rclone/new_backups/minio_backup/

[remote]
type = alias
remote = test:/home/shivam/rclone/data
2021/10/22 15:37:05 DEBUG : rclone: Version "v1.56.2" starting with parameters ["rclone" "sync" "--no-update-modtime" "--log-level" "DEBUG" "remote:" "backup:weekly" "--backup-dir" "backup:daily/2021-10-22T153704"]
2021/10/22 15:37:05 DEBUG : Creating backend with remote "remote:"
2021/10/22 15:37:05 DEBUG : Using config file from "/home/shivam/.config/rclone/rclone.conf"
2021/10/22 15:37:05 DEBUG : Creating backend with remote "test:/home/shivam/rclone/data"
2021/10/22 15:37:05 DEBUG : fs cache: renaming cache item "remote:" to be canonical "test:/home/shivam/rclone/data"
2021/10/22 15:37:05 DEBUG : Creating backend with remote "backup:weekly"
2021/10/22 15:37:05 DEBUG : Creating backend with remote "test:/home/shivam/rclone/new_backups/minio_backup/weekly"
2021/10/22 15:37:05 DEBUG : fs cache: renaming cache item "backup:weekly" to be canonical "test:/home/shivam/rclone/new_backups/minio_backup/weekly"
2021/10/22 15:37:05 DEBUG : Creating backend with remote "backup:daily/2021-10-22T153704"
2021/10/22 15:37:05 DEBUG : Creating backend with remote "test:/home/shivam/rclone/new_backups/minio_backup/daily/2021-10-22T153704"
2021/10/22 15:37:05 DEBUG : fs cache: renaming cache item "backup:daily/2021-10-22T153704" to be canonical "test:/home/shivam/rclone/new_backups/minio_backup/daily/2021-10-22T153704"
2021/10/22 15:37:05 DEBUG : Local file system at /home/shivam/rclone/new_backups/minio_backup/weekly: Waiting for checks to finish
2021/10/22 15:37:05 DEBUG : Local file system at /home/shivam/rclone/new_backups/minio_backup/weekly: Waiting for transfers to finish
2021/10/22 15:37:05 DEBUG : file.txt: md5 = 8ddd8be4b179a529afa5f2ffae4b9858 OK
2021/10/22 15:37:05 INFO  : file.txt: Copied (new)
2021/10/22 15:37:05 DEBUG : Waiting for deletions to finish
2021/10/22 15:37:05 INFO  :
Transferred:             13 / 13 Byte, 100%, 0 Byte/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.5s

2021/10/22 15:37:05 DEBUG : 3 go routines active

Directory tree after running rclone

image

hello and welcome to the forum,

rclone will only move a file into that --backup-dir folder if the corresponding source file has changed.

to force that change can you try:

  1. touch file.txt or edit the file.txt to change the contents
  2. run the rclone command again.
  3. post the debug log

You may actually want --copy-dest-dir (docs) which will make it have a full copy. If you just want the new files copied to a new dir, check out --compare-dest-dir (docs).

--backup-dir tells rclone to move files there instead of deleting or before overwriting.

hi,

if you want an good example of --compare-dest-dir, check out this topic, where it solved the OP issue.
https://forum.rclone.org/t/rclone-copy-using-regex-expression-using-include-multiple-expression-for-file-name/26846/39?u=asdffdsa

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