Feature: Backup and versioning (--backup, --backup-dir, --suffix) #178
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Corresponding rsync flags/behavior:
--backup— make backups of files that are about to be replaced or deleted--backup-dir=DIR— put backups into a separate directory hierarchy--suffix=SUFFIX— backup filename suffix (default~)Current FastSync behavior:
There is no backup support. When
--deleteremoves a file or an incremental transfer overwrites an existing file, the old version is lost permanently.Proposed changes:
--backup,--backup-dir=<dir>,--suffix=<suffix>bool use_backup,char* backup_dir,char* backup_suffix<path><suffix>or move it to<backup-dir>/<relative-path><suffix>Priority: medium
Rationale: Backups are critical for safe synchronization, especially when
--deleteis used. Users need a safety net against accidental data loss.Acceptance criteria:
--backupcreatesfile.txt~before overwritingfile.txt--backup-dir=backupsmoves old versions intobackups/<relative-path>~--suffix=.bakchanges the backup suffix--deleteremovals and incremental overwrites