1 A patch from Stefan Müller to add the --downdate option, which works
2 in the opposite manner as --update.
4 To use this patch, run these commands for a successful build:
6 patch -p1 <patches/downdate.diff
7 ./configure (optional if already run)
10 based-on: a01e3b490eb36ccf9e704840e1b6683dab867550
11 diff --git a/generator.c b/generator.c
14 @@ -56,6 +56,7 @@ extern int ignore_errors;
15 extern int remove_source_files;
16 extern int delay_updates;
17 extern int update_only;
18 +extern int downdate_only;
19 extern int human_readable;
20 extern int ignore_existing;
21 extern int ignore_non_existing;
22 @@ -1529,6 +1530,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
26 + if (downdate_only && statret == 0
27 + && cmp_time(sx.st.st_mtime, file->modtime) < 0) {
28 + if (INFO_GTE(SKIP, 1))
29 + rprintf(FINFO, "%s is older\n", fname);
34 fnamecmp_type = FNAMECMP_FNAME;
36 @@ -1962,6 +1970,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
37 ignore_existing = -ignore_existing;
38 ignore_non_existing = -ignore_non_existing;
39 update_only = -update_only;
40 + downdate_only = -downdate_only;
41 always_checksum = -always_checksum;
42 size_only = -size_only;
43 append_mode = -append_mode;
44 @@ -1987,6 +1996,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
45 ignore_existing = -ignore_existing;
46 ignore_non_existing = -ignore_non_existing;
47 update_only = -update_only;
48 + downdate_only = -downdate_only;
49 always_checksum = -always_checksum;
50 size_only = -size_only;
51 append_mode = -append_mode;
52 diff --git a/options.c b/options.c
55 @@ -60,6 +60,7 @@ int preserve_uid = 0;
57 int preserve_times = 0;
59 +int downdate_only = 0;
63 @@ -671,6 +672,7 @@ void usage(enum logcode F)
64 rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
65 rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
66 rprintf(F," -u, --update skip files that are newer on the receiver\n");
67 + rprintf(F," -w, --downdate skip files that are older on the receiver\n");
68 rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
69 rprintf(F," --append append data onto shorter files\n");
70 rprintf(F," --append-verify like --append, but with old data in file checksum\n");
71 @@ -892,6 +894,7 @@ static struct poptOption long_options[] = {
72 {"no-one-file-system",'x',POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
73 {"no-x", 'x', POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
74 {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
75 + {"downdate", 'w', POPT_ARG_NONE, &downdate_only, 0, 0, 0 },
76 {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
77 {"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
78 {"ignore-existing", 0, POPT_ARG_NONE, &ignore_existing, 0, 0, 0 },