From d9a245ec8c2236e897771459467a8c7c753ce341 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 16 Jun 2026 18:30:56 +0200 Subject: feat: add --delete to dir rsync so backup mirrors source Removed/moved files in backed-up directories are now pruned from the backup instead of accumulating. Applies only to directory copies, not the per-file branch or restore. Co-Authored-By: Claude Opus 4.8 --- dot-backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dot-backup.sh b/dot-backup.sh index 34558ca..701153f 100755 --- a/dot-backup.sh +++ b/dot-backup.sh @@ -200,9 +200,9 @@ do_rsync() { if [[ "$is_dir" == true ]]; then mkdir -p "$dst" if [[ "$VERBOSE" == true ]]; then - rsync -av "$src/" "$dst/" + rsync -av --delete "$src/" "$dst/" else - rsync -a "$src/" "$dst/" && echo -e "\t ${GREEN}Copied${NC}" + rsync -a --delete "$src/" "$dst/" && echo -e "\t ${GREEN}Copied${NC}" fi else mkdir -p "$(dirname "$dst")" -- cgit v1.2.3