Skip to main content

Rclone Backup Dir Pattern

--backup-dir is the primary rollback control for sync operations. It converts destructive updates into recoverable moves with clear restore points.

Pattern​

rclone sync /srv/site remote:site/current \
--delete-after \
--backup-dir remote:site/rollback/$(date +%F-%H%M) \
--suffix .bak

Why It Matters​

  • Keeps overwritten versions for rollback.
  • Preserves destination-only files removed by sync.
  • Reduces incident blast radius.

Examples with Output​

1. Example 1​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-01-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-01-0100)
Would transfer 46 files

2. Example 2​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-02-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-02-0100)
Would transfer 52 files

3. Example 3​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-03-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-03-0100)
Would transfer 58 files

4. Example 4​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-04-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-04-0100)
Would transfer 64 files

5. Example 5​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-05-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-05-0100)
Would transfer 70 files

6. Example 6​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-06-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-06-0100)
Would transfer 76 files

7. Example 7​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-07-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-07-0100)
Would transfer 82 files

8. Example 8​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-08-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-08-0100)
Would transfer 88 files

9. Example 9​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-09-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-09-0100)
Would transfer 94 files

10. Example 10​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-10-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-10-0100)
Would transfer 100 files

11. Example 11​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-11-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-11-0100)
Would transfer 106 files

12. Example 12​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-12-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-12-0100)
Would transfer 112 files

13. Example 13​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-13-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-13-0100)
Would transfer 118 files

14. Example 14​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-14-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-14-0100)
Would transfer 124 files

15. Example 15​

Input command:

rclone sync /srv/site remote:site/current --delete-after --backup-dir remote:site/rollback/2026-02-15-0100 --suffix .bak --dry-run

Expected output:

NOTICE: safety profile applied (2026-02-15-0100)
Would transfer 130 files