From c2c5682c0b5b56b455d9e7bada05f211213818c2 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 16 Dec 2005 17:18:29 +0000 Subject: [PATCH] If the user specifies --backup with --delete (but without --backup-dir and --delete-excluded), append a protect-filter rule onto the list of filter rules. We run this on both the client and server side so that an older client talking to a newer server still gets the protection rule. (This rule will not cause compatibility problems with older versions of rsync due to the graceful way that a protect rule turns into an exclude rule if it needs to be sent to an older server.) --- options.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/options.c b/options.c index 698f4fc3..a66c8e0f 100644 --- a/options.c +++ b/options.c @@ -1207,6 +1207,10 @@ int parse_arguments(int *argc, const char ***argv, int frommain) snprintf(err_buf, sizeof err_buf, "--suffix cannot be a null string without --backup-dir\n"); return 0; + } else if (delete_mode && !delete_excluded) { + snprintf(backup_dir_buf, sizeof backup_dir_buf, + "P *%s", backup_suffix); + parse_rule(&filter_list, backup_dir_buf, 0, 0); } if (make_backups && !backup_dir) omit_dir_times = 1; -- 2.34.1