Patch from Jeremy Bornstein to transfer files only by mtime, not
[rsync-patches.git] / jjb-delete-only.diff
1 Greetings, and thanks for all of your work on the wonderful rsync!
2
3 I recently had the need to transfer files only with different mod
4 dates (and to *not* transfer them based on file size differences).
5 This is because I'm backing up files remotely on an untrusted machine,
6 so I'm encrypting them with gpg before transfer.  I discovered that
7 rsync didn't already have a --date-only flag, so I added one and am
8 enclosing the diffs in case you (as I hope) decide to include this
9 option in future releases.
10
11 Again, thanks!
12
13 Best Regards,
14 Jeremy Bornstein
15 diff rsync-2.5.4/README rsync-2.5.4-patched/README
16 70a71
17 >      --date-only             only use modification date when determining if a file should be transferred
18 Common subdirectories: rsync-2.5.4/doc and rsync-2.5.4-patched/doc
19 diff rsync-2.5.4/generator.c rsync-2.5.4-patched/generator.c
20 39a40
21 > extern int date_only;
22 50a52,56
23 >       if (date_only) {
24 >               return (cmp_modtime(st->st_mtime,file->modtime) == 0);
25 >       }
26
27
28 Common subdirectories: rsync-2.5.4/lib and rsync-2.5.4-patched/lib
29 diff rsync-2.5.4/options.c rsync-2.5.4-patched/options.c
30 64a65
31 > int date_only=0;
32 223a225
33 >   rprintf(F,"     --date-only             only use modification date when determining if a file should be transferred\n");
34 265c267
35 <       OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS,
36 ---
37 >       OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_DATE_ONLY, OPT_ADDRESS,
38 278a281
39 >   {"date-only",        0,  POPT_ARG_NONE,   &date_only},
40 704a708,710
41
42 >       if (date_only)
43 >               args[ac++] = "--date-only";
44 Common subdirectories: rsync-2.5.4/packaging and rsync-2.5.4-patched/packaging
45 Common subdirectories: rsync-2.5.4/popt and rsync-2.5.4-patched/popt
46 diff rsync-2.5.4/rsync.1 rsync-2.5.4-patched/rsync.1
47 289a290
48 >      --date-only             only use modification date when determining if a file should be transferred
49 363a365,371
50 > .IP 
51 > .IP "\fB--date-only\fP" 
52 > Normally rsync will skip any files that are
53 > already the same length and have the same time-stamp\&. With the
54 > --date-only option files will be skipped if they have the same timestamp,
55 > regardless of size\&. This may be useful when the remote files have passed
56 > through a size-changing filter, e.g. for encryption\&.
57 diff rsync-2.5.4/rsync.yo rsync-2.5.4-patched/rsync.yo
58 260a261
59 >      --date-only             only use modification date when determining if a file should be transferred
60 326a328,333
61
62 > dit(bf(--date-only)) Normally rsync will skip any files that are
63 > already the same length and have the same time-stamp. With the
64 > --date-only option files will be skipped if they have the same
65 > timestamp, regardless of size. This may be useful when the remote
66 > files have passed through a size-changing filter, e.g. for encryption.
67 Common subdirectories: rsync-2.5.4/testhelp and rsync-2.5.4-patched/testhelp
68 Common subdirectories: rsync-2.5.4/testsuite and rsync-2.5.4-patched/testsuite
69 Common subdirectories: rsync-2.5.4/zlib and rsync-2.5.4-patched/zlib