(fwd from uke@jeremy.org) thanks and patch

jeremy bornstein uke at jeremy.org
Thu Mar 21 10:00:49 EST 2002


Dave Dykstra wrote:
> Wouldn't encrypting the file with gpg change the timestamp as well as the
> size, so rsync would still copy the file?

It certainly does--which is why I reset it afterwards.

Although the backup script I use is pretty simple, having this patch
to rsync does not obviate it.   I actually call rsync twice--once to
determine the list of files to be transferred, and once to transfer
the encrypted files.  In-between I do the actual encryption (and 
munging of the mod dates).

-j

> On Tue, Mar 19, 2002 at 08:21:36AM -0800, jeremy bornstein wrote:
> > Martin,
> > 
> > The encryption program I'm using, gpg, includes a small bit of header
> > information with the encrypted file, thus changing the size.  Gpg is a
> > public key encryption program which at least includes the numeric key
> > ID of the recipient's key.  Since folks can have many keys, this is
> > useful information to have with each bit of data.  It might be
> > possible to strip this information off, but then the whole process
> > would be version-sensitive and thus error-prone, which is not what I'd
> > like in a backup program!
> > 
> > (There's much more info at <URL:http://www.gnupg.org/> if you like.)
> > 
> > I suspect I'm not the only one who would be interested in using this
> > feature for this purpose, but of course I can't say for certain.
> > 
> > Best,
> > 
> > -jeremy
> > 
> > On Tue, Mar 19, 2002 at 06:11:44AM +1100, Martin Pool wrote:
> > > Jeremy, 
> > > 
> > > I'm glad you like rsync.
> > > 
> > > Why does your encryption program not produce a file of the same size
> > > every time it is run on the same input?  I can see what the patch
> > > does, but I'm having a bit of trouble understanding whether it would
> > > be generally useful.
> > > 
> > > -- 
> > > Martin 
> > 
> > > Date: Sun, 17 Mar 2002 06:31:40 -0800
> > > From: jeremy bornstein <uke at jeremy.org>
> > > To: Martin Pool <mbp at sourcefrog.net>
> > > Subject: thanks and patch
> > > 
> > > Greetings, and thanks for all of your work on the wonderful rsync!
> > > 
> > > I recently had the need to transfer files only with different mod
> > > dates (and to *not* transfer them based on file size differences).
> > > This is because I'm backing up files remotely on an untrusted machine,
> > > so I'm encrypting them with gpg before transfer.  I discovered that
> > > rsync didn't already have a --date-only flag, so I added one and am
> > > enclosing the diffs in case you (as I hope) decide to include this
> > > option in future releases.
> > > 
> > > Again, thanks!
> > > 
> > > Best Regards,
> > > Jeremy Bornstein
> > 
> > > diff rsync-2.5.4/README rsync-2.5.4-patched/README
> > > 70a71
> > > >      --date-only             only use modification date when determining if a file should be transferred
> > > Common subdirectories: rsync-2.5.4/doc and rsync-2.5.4-patched/doc
> > > diff rsync-2.5.4/generator.c rsync-2.5.4-patched/generator.c
> > > 39a40
> > > > extern int date_only;
> > > 50a52,56
> > > > 	if (date_only) {
> > > > 		return (cmp_modtime(st->st_mtime,file->modtime) == 0);
> > > > 	}
> > > > 
> > > > 
> > > Common subdirectories: rsync-2.5.4/lib and rsync-2.5.4-patched/lib
> > > diff rsync-2.5.4/options.c rsync-2.5.4-patched/options.c
> > > 64a65
> > > > int date_only=0;
> > > 223a225
> > > >   rprintf(F,"     --date-only             only use modification date when determining if a file should be transferred\n");
> > > 265c267
> > > <       OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS,
> > > ---
> > > >       OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_DATE_ONLY, OPT_ADDRESS,
> > > 278a281
> > > >   {"date-only",        0,  POPT_ARG_NONE,   &date_only},
> > > 704a708,710
> > > > 
> > > > 	if (date_only)
> > > > 		args[ac++] = "--date-only";
> > > Common subdirectories: rsync-2.5.4/packaging and rsync-2.5.4-patched/packaging
> > > Common subdirectories: rsync-2.5.4/popt and rsync-2.5.4-patched/popt
> > > diff rsync-2.5.4/rsync.1 rsync-2.5.4-patched/rsync.1
> > > 289a290
> > > >      --date-only             only use modification date when determining if a file should be transferred
> > > 363a365,371
> > > > .IP 
> > > > .IP "\fB--date-only\fP" 
> > > > Normally rsync will skip any files that are
> > > > already the same length and have the same time-stamp\&. With the
> > > > --date-only option files will be skipped if they have the same timestamp,
> > > > regardless of size\&. This may be useful when the remote files have passed
> > > > through a size-changing filter, e.g. for encryption\&.
> > > diff rsync-2.5.4/rsync.yo rsync-2.5.4-patched/rsync.yo
> > > 260a261
> > > >      --date-only             only use modification date when determining if a file should be transferred
> > > 326a328,333
> > > > 
> > > > dit(bf(--date-only)) Normally rsync will skip any files that are
> > > > already the same length and have the same time-stamp. With the
> > > > --date-only option files will be skipped if they have the same
> > > > timestamp, regardless of size. This may be useful when the remote
> > > > files have passed through a size-changing filter, e.g. for encryption.
> > > Common subdirectories: rsync-2.5.4/testhelp and rsync-2.5.4-patched/testhelp
> > > Common subdirectories: rsync-2.5.4/testsuite and rsync-2.5.4-patched/testsuite
> > > Common subdirectories: rsync-2.5.4/zlib and rsync-2.5.4-patched/zlib
> > 
> > 
> > 
> > -- 
> >                    jeremy bornstein <jeremy at thinger.org>
> >                                     -*-
> >       to be free of all authority, of your own and that of another, is
> >        to die to everything of yesterday, so that your mind is always
> >          fresh, always young, innocent, full of vigour and passion.
> >                 [j. krishnamurti, _freedom from the known_]
> >                                     -*-
> >                              http://jeremy.org/
> > 
> > -- 
> > To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> > Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html




More information about the rsync mailing list