I run several backup scripts by cron, one of which backs up my mail. I do not want it to back up the Trash folder, but it appears to be doing so. I conclude that my script is faulty somewhere, and would be grateful for advice.
The command is
rsync -auvz --delete-after --exclude-from=/home/anne/rsync_skiplist_mail.txt /home/anne/Maildir/ /Data3/anne/Maildir/
where rsync_skiplist_mail.txt says
*~ .[a-z]* .[A-Z]* Maildir/.INBOX.Bugs/ Maildir/.Trash/
Comments, please?
Anne
On Tue, Apr 8, 2008 at 5:18 AM, Anne Wilson cannewilson@googlemail.com wrote:
I run several backup scripts by cron, one of which backs up my mail. I do not want it to back up the Trash folder, but it appears to be doing so. I conclude that my script is faulty somewhere, and would be grateful for advice.
The command is
rsync -auvz --delete-after --exclude-from=/home/anne/rsync_skiplist_mail.txt /home/anne/Maildir/ /Data3/anne/Maildir/
where rsync_skiplist_mail.txt says
*~ .[a-z]* .[A-Z]* Maildir/.INBOX.Bugs/ Maildir/.Trash/
Comments, please?
I've always found exclude patterns to be a trial and error process, mostly errors. They never seem to do what you think they will. As a starting point, I would try putting a / in from of the Maildir patterns and put ** at the end of them.
From "man rsync" (sorry, I know you're a CentOS list regular and have
probably read the man page, but sometimes the relevant text fails to stand out):
The easiest way to see what name you should include/exclude is to just look at the output when using --verbose and put a / in front of the name (use the --dry- run option if you're not yet ready to copy any files).
I think this is one of the weakest features of rsync. I wish they would implement something that would generate more predictable outcomes.
-- Jeff
On Tuesday 08 April 2008 15:16:22 Jeff Larsen wrote:
On Tue, Apr 8, 2008 at 5:18 AM, Anne Wilson cannewilson@googlemail.com
wrote:
I run several backup scripts by cron, one of which backs up my mail. I do not want it to back up the Trash folder, but it appears to be doing so. I conclude that my script is faulty somewhere, and would be grateful for advice.
The command is
rsync -auvz --delete-after --exclude-from=/home/anne/rsync_skiplist_mail.txt /home/anne/Maildir/ /Data3/anne/Maildir/
where rsync_skiplist_mail.txt says
*~ .[a-z]* .[A-Z]* Maildir/.INBOX.Bugs/ Maildir/.Trash/
Comments, please?
I've always found exclude patterns to be a trial and error process, mostly errors. They never seem to do what you think they will. As a starting point, I would try putting a / in from of the Maildir patterns and put ** at the end of them.
From "man rsync" (sorry, I know you're a CentOS list regular and have
probably read the man page, but sometimes the relevant text fails to stand out):
Many times, but it's *very* long, and it's easy to miss the relevant bit.
The easiest way to see what name you should include/exclude is
to just look at the output when using --verbose and put a / in front of the name (use the --dry- run option if you're not yet ready to copy any files).
I think this is one of the weakest features of rsync. I wish they would implement something that would generate more predictable outcomes.
I've used it successfully for quite a long time, but I'm using it on a lot more varied data sets now. When I started I was told that it referenced a base, in this instance /home/anne/ and therefore Maildir should not have a '/'. This seems to have worked fine on other sets. Still, I'll play around with that suggestion and see what I can find. If I solve it I'll report back for the sake of the archives.
Thanks
Anne
On Tuesday 08 April 2008 15:16, Jeff Larsen wrote:
On Tue, Apr 8, 2008 at 5:18 AM, Anne Wilson cannewilson@googlemail.com
wrote:
I run several backup scripts by cron, one of which backs up my mail. I do not want it to back up the Trash folder, but it appears to be doing so. I conclude that my script is faulty somewhere, and would be grateful for advice.
The command is
rsync -auvz --delete-after --exclude-from=/home/anne/rsync_skiplist_mail.txt /home/anne/Maildir/ /Data3/anne/Maildir/
where rsync_skiplist_mail.txt says
*~ .[a-z]* .[A-Z]* Maildir/.INBOX.Bugs/ Maildir/.Trash/
Comments, please?
I've always found exclude patterns to be a trial and error process, mostly errors. They never seem to do what you think they will. As a starting point, I would try putting a / in from of the Maildir patterns and put ** at the end of them.
From "man rsync" (sorry, I know you're a CentOS list regular and have
probably read the man page, but sometimes the relevant text fails to stand out):
The easiest way to see what name you should include/exclude is
to just look at the output when using --verbose and put a / in front of the name (use the --dry- run option if you're not yet ready to copy any files).
I think this is one of the weakest features of rsync. I wish they would implement something that would generate more predictable outcomes.
--dry-run with --verbose proved informative. My pattern matching was excluding most of them, so I wasn't getting the backup I thought I was. It looks as though that particular exclude file should be only
Maildir/.INBOX.Bugs/ Maildir/.Trash/
Thanks for pointing me to the solution.
Anne
Anne Wilson cannewilson@googlemail.com writes:
The command is
rsync -auvz --delete-after --exclude-from=/home/anne/rsync_skiplist_mail.txt /home/anne/Maildir/ /Data3/anne/Maildir/
The roots are the Maildirs themselves, so it should not be necessary to re-specify them in the exclude list.
where rsync_skiplist_mail.txt says
*~ .[a-z]* .[A-Z]* Maildir/.INBOX.Bugs/ Maildir/.Trash/
I would use instead:
/.INBOX.Bugs/ /.Trash/
Not sure what the others are supposed to match...
Comments, please?
Hope this helps,
On Tuesday 08 April 2008 17:58, Nicolas KOWALSKI wrote:
Anne Wilson cannewilson@googlemail.com writes:
The command is
rsync -auvz --delete-after --exclude-from=/home/anne/rsync_skiplist_mail.txt /home/anne/Maildir/ /Data3/anne/Maildir/
The roots are the Maildirs themselves, so it should not be necessary to re-specify them in the exclude list.
where rsync_skiplist_mail.txt says
*~ .[a-z]* .[A-Z]* Maildir/.INBOX.Bugs/ Maildir/.Trash/
I would use instead:
/.INBOX.Bugs/ /.Trash/
Not sure what the others are supposed to match...
I didn't see this until after I had followed up Jeff's suggestions, but thanks for trying to help.
Anne