permissions bug w/ --backup-dir or --backup option?

James Delahanty jimd at
Thu Sep 20 05:50:35 EST 2001


Well, I'm not sure what platform/filesystem you're running on, but we
use rsync on linux (ext2fs) with the --backup-dir and -a options,
backing files up to a different volume on the same machine, and don't
have the problem you describe.  The backup partition is natively mounted
(not NFS, or SMB, or whatever).

I've looked at the code for backup-dir (okay, actually, I *wrote* the
code for backup-dir :^)  If rsync *can* set the permissions on the
file(s), it will.  Examine the code in backup.c and set_perms() in
rsync.c.  It looks pretty solid to me, and has really worked well for

A typical (for us) run is executed like this:

rsync -abHS --backup-dir=/mnt/backup/spud /mnt/spud/a/

And we've done 19,658 runs so far (8/server/day), over 380 Gigs sync'd
with an average of 44Meg(11Meg compressed) of data per run, and all of
our backup files come across with correct owners and permissions.  Whew!

I'd look to your filesystem first.  Do the rsync'd files (not backup-dir
files) come across with the right permissions?

Jim Delahanty
jimd at

> From: "Carey Jung" <carey at>
> To: "rsync list" <rsync at>
> Subject: RE: permissions bug w/ --backup-dir or --backup option?
> Date: Wed, 19 Sep 2001 00:41:17 -0500
> By the way, if it makes a difference, our backup-dir is on a different
> partition than the destination directory.  I'm not sure if --backup
> permissions/ownership are preserved properly if done on the same partition.
> Carey
> > -----Original Message-----
> > From: rsync-admin at [mailto:rsync-admin at]On
> > Behalf Of Carey Jung
> > Sent: Wednesday, September 19, 2001 12:38 AM
> > To: rsync list
> > Subject: permissions bug w/ --backup-dir or --backup option?
> >
> >
> > Running rsync 2.4.7pre1, using the --backup-dir option, I just realized
> > today that file ownerships and permissions of backed up files are not
> > preserved.   In other words, if rsync moves an obsolete file to the backup
> > dir, it's ownership seems to revert to root:root, and permissions
> > change, as
> > well.  We are also using the -a (archive) option, by the way, which should
> > mean "preserve everything".  This loss of ownership/permissions
> > seems like a
> > definite bug to me.  What do you think?
> >
> > Regards,
> > Carey Jung
> > IT Freedom
> >

More information about the rsync mailing list