Hide "File has vanished" warnings from rsync in zzz_evobackup script #36

Open
opened 2020-04-09 16:31:32 +02:00 by lpoujol · 2 comments
Owner

Can we hide the "File has vanished" warning ?
This is generatig too much noise for garbage :/


/etc/cron.daily/zzz_evobackup:
    file has vanished: "/home/foo/bar/baz"
    (...)
    rsync warning: some files vanished before they could be transferred (code 24) at main.c(1196) [sender=3.1.2]
Can we hide the "File has vanished" warning ? This is generatig too much noise for garbage :/ ``` /etc/cron.daily/zzz_evobackup: file has vanished: "/home/foo/bar/baz" (...) rsync warning: some files vanished before they could be transferred (code 24) at main.c(1196) [sender=3.1.2] ```
lpoujol added the
zzz_evobackup
label 2020-04-09 16:31:32 +02:00
Owner

Rsync itself doesn't offer a way to filter those warnings, but the issue is so common that they provided a wrapper script to eliminate them : https://git.samba.org/?p=rsync.git;a=blob_plain;f=support/rsync-no-vanished;hb=HEAD

It looks like this :

#!/bin/bash

IGNOREEXIT=24
IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)'

set -o pipefail

rsync "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true)
ret=$?

if [[ $ret == $IGNOREEXIT ]]; then
    ret=0
fi

exit $ret

Do you think we should embed this in the backup script, use the wrapper as an external script or don't use this at all?

Rsync itself doesn't offer a way to filter those warnings, but the issue is so common that they provided a wrapper script to eliminate them : https://git.samba.org/?p=rsync.git;a=blob_plain;f=support/rsync-no-vanished;hb=HEAD It looks like this : ``` #!/bin/bash IGNOREEXIT=24 IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)' set -o pipefail rsync "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true) ret=$? if [[ $ret == $IGNOREEXIT ]]; then ret=0 fi exit $ret ``` Do you think we should embed this in the backup script, use the wrapper as an external script or don't use this at all?
Contributor

Personally I quite like the idea if there are no drawbacks using this tiny and a little bit ugly hack. :)

Personally I quite like the idea if there are no drawbacks using this tiny and a little bit ugly hack. :)
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evobackup#36
No description provided.