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)
12 @@ -54,6 +54,7 @@ extern int ignore_errors;
13 extern int remove_source_files;
14 extern int delay_updates;
15 extern int update_only;
16 +extern int downdate_only;
17 extern int ignore_existing;
18 extern int ignore_non_existing;
20 @@ -1528,6 +1529,13 @@ static void recv_generator(char *fname,
24 + if (downdate_only && statret == 0
25 + && cmp_time(sx.st.st_mtime, file->modtime) < 0) {
27 + rprintf(FINFO, "%s is older\n", fname);
32 fnamecmp_type = FNAMECMP_FNAME;
34 @@ -1825,6 +1833,7 @@ void check_for_finished_files(int itemiz
35 ignore_existing = -ignore_existing;
36 ignore_non_existing = -ignore_non_existing;
37 update_only = -update_only;
38 + downdate_only = -downdate_only;
39 always_checksum = -always_checksum;
40 size_only = -size_only;
41 append_mode = -append_mode;
42 @@ -1850,6 +1859,7 @@ void check_for_finished_files(int itemiz
43 ignore_existing = -ignore_existing;
44 ignore_non_existing = -ignore_non_existing;
45 update_only = -update_only;
46 + downdate_only = -downdate_only;
47 always_checksum = -always_checksum;
48 size_only = -size_only;
49 append_mode = -append_mode;
52 @@ -57,6 +57,7 @@ int preserve_uid = 0;
54 int preserve_times = 0;
56 +int downdate_only = 0;
60 @@ -318,6 +319,7 @@ void usage(enum logcode F)
61 rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
62 rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
63 rprintf(F," -u, --update skip files that are newer on the receiver\n");
64 + rprintf(F," -w, --downdate skip files that are older on the receiver\n");
65 rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
66 rprintf(F," --append append data onto shorter files\n");
67 rprintf(F," --append-verify like --append, but with old data in file checksum\n");
68 @@ -522,6 +524,7 @@ static struct poptOption long_options[]
69 {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
70 {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
71 {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
72 + {"downdate", 'w', POPT_ARG_NONE, &downdate_only, 0, 0, 0 },
73 {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
74 {"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
75 {"ignore-existing", 0, POPT_ARG_NONE, &ignore_existing, 0, 0, 0 },