[Bug 2647] New: --exclude options work from commandline but not in script

samba-bugs at samba.org samba-bugs at samba.org
Mon Apr 25 20:46:06 GMT 2005


https://bugzilla.samba.org/show_bug.cgi?id=2647

           Summary: --exclude options work from commandline but not in
                    script
           Product: rsync
           Version: 2.6.4
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: jason at jasonpfeil.com
         QAContact: rsync-qa at samba.org


Greetings!  Thank you for such a wonderful tool in rsync.

I am trying to use rsync to back up one filesystem tree to another on the same
disk.  The catch is that the destination tree is mounted under the source tree.
 To prevent the backup from getting a copy of itself, I have tried to use the
--exclude option, but to no avail.  The general procedure for my script is to cd
to the destinateion directory (in this case: /mnt/backup) and rsync the source
directory (in this case: /) to the destination directory.  Here's the command
that gets run:

/usr/bin/rsync -v --progress --delete --stats --exclude='/proc/'
--exclude='/sys/' --exclude='/mnt/sysbackup/' -aS / .

I want to exclude the /sys, /proc, and /mnt/sysbackup directories and
*everything* underneath them from being backed up to the /mnt/sysbackup
directory.  The kicker is that if I run that command manually like so:

( cd /mnt/sysbackup; /usr/bin/rsync -v --progress --delete --stats
--exclude='/proc/' --exclude='/sys/' --exclude='/mnt/sysbackup/' -aS / . )

it works fine.  When the exact same rsync command is run from within the script
(following the cd /mnt/sysbackup command), I get a /mnt/sysbackup/mnt/sysbackup
directory with *everything* under the /mnt/sysbackup directory duplicated.  I
also get /mnt/sysbackup/sys and /mnt/sysbackup/proc directories complete with
data in them.

Cheers!

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the rsync mailing list