Hi, My cron backup scripts often send me mails because of error 24 (Partial transfer due to vanished source files). However, this is normal when backing up user homes with IMAP folders. So I would like to suppress only this particular error. I have not found an rsync option to suppress this error. Is there some way to filter this out? Thanks, Mi
Scott Wiersdorf
2011-Jan-31 15:52 UTC
How to ignore error 24 or mask it out in bash rsync script
On Mon, Jan 31, 2011 at 01:35:20PM +0100, Mi wrote:> My cron backup scripts often send me mails because of error 24 (Partial > transfer due to vanished source files). However, this is normal when > backing up user homes with IMAP folders. So I would like to suppress only > this particular error.I don't see an obvious way to turn off that error in the source. You could redirect your stderr to stdout and grep it out, then put it back on stderr: rsync -a /foo /bar 2>&1 | grep -v 'vanished source files' 1>&2 Scott -- Scott Wiersdorf scott at ipartner.net
Mikolaj Kucharski
2011-Jan-31 21:59 UTC
How to ignore error 24 or mask it out in bash rsync script
On Mon, Jan 31, 2011 at 01:35:20PM +0100, Mi wrote:> Hi, > > My cron backup scripts often send me mails because of error 24 (Partial transfer due to vanished source files). However, this is normal when backing up user homes with IMAP folders. So I would like to suppress only this particular error. > > I have not found an rsync option to suppress this error. Is there some way to filter this out?Didn't test below code, but you should get the idea.. #!/bin/sh rsync ... # your backup options go here case $? in 0|24) exit 0 # success ;; *) exit $? # error ;; esac -- best regards q#