Hi I'm trying to take a backup of all the users emails on a server using rsync, but there is probably something about the patterns I haven't understood quite. Every user has a folder called Maildir in their home directory. So the structure is like this: /home/user1/Maildir /home/user2/Maildir etc. I'm not interested in backing up the other folders that the users might have. The "mailbackup" share points to the /home folder so I'm trying the following without success: rsync -av --include "/*/Maildir/**" --exclude "*" -recursive server::mailbackup . This backs up nothing. Why doesn't this work? Could anyone enlighten me? Best regards, Snorre
On Thu, Nov 06, 2003 at 10:48:37AM +0100, Snorre Narum Garmann wrote:> Hi > > I'm trying to take a backup of all the users emails on a server using rsync, > but there is probably something about the patterns I haven't understood > quite. > > > > Every user has a folder called Maildir in their home directory. > > > > So the structure is like this: > > /home/user1/Maildir > > /home/user2/Maildir > > etc. > > > > I'm not interested in backing up the other folders that the users might > have. > > > > The "mailbackup" share points to the /home folder so I'm trying the > following without success: > > > > rsync -av --include "/*/Maildir/**" --exclude "*" -recursive > server::mailbackup . > > > > This backs up nothing. Why doesn't this work? Could anyone enlighten me?Because you failed to include the parent directories all the way up the line. Read the manpage section on EXCLUDE PATTERNS. I'd use --exclude-from because you will need more patterns than one normally wants on the command-line. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt
On Thu, Nov 06, 2003 at 10:48:37AM +0100, Snorre Narum Garmann wrote:> rsync -av --include "/*/Maildir/**" --exclude "*" -recursive > server::mailbackup .Isn't this copying the wrong way? i.e. don't you want to send files TO the mailbackup server? In any respect, this is a case where include/exclude is overkill. Just do something like this: cd /home; rsync -avR */Maildir server::mailbackup or, if you really wanted to pull, this: rsync -avR 'server::mailbackup/*/Maildir' /home ..wayne..