home backup files vanish
|
28th Apr, 2021, 09:25 PM
Post: #10
|
|||
|
|||
RE: home backup files vanish
(27th Apr, 2021 06:13 PM)alcina Wrote: So I think the error is coming from cpb, i.e the second exit code in the pipe as a whole. But I don't know why. /tmp/xbiancopy.log contains lots of stuff relating to successful btrfs and ends "Operation sucessfully completed!". /tmp/backuphome.log contains the lines starting with positive digits from the output of pv in the pipe as the grep implies. This was also my first thought, but all tests I have done always lead to the same result: cpb() never terminates with an error in the xbian-storager script. However, in a simplified test program it does give an error. But why this sometimes brings an error and sometimes not is completely unclear to me. Terminal kmnote5:/tmp # cat t.sh #!/bin/bash PIPECMD="cat > /tmp/out.log" cpb () { ar=0 while read a; do echo "$a" | grep -q ^[0-9] && { (($a > $ar)) && ar=$a; echo "$a"; } done | eval $PIPECMD || : } set -o pipefail false | true | echo -e "1\n2\n3\n" | cpb ps=${PIPESTATUS[*]} RC=0; for i in $ps; do [ "$i" -ne 0 ] && RC=$i; done echo $RC, $ps kmnote5:/tmp # ./t.sh 1, 1 0 0 0 The solution seems simple, just add a ' || :' after the $PIPECMD this deletes the strange error if it occurs. Code: diff --git a/content/usr/local/sbin/xbian-storager b/content/usr/local/sbin/xbian-storager |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
home backup files vanish - alcina - 16th Apr, 2021, 02:19 AM
RE: home backup files vanish - Nachteule - 16th Apr, 2021, 11:39 PM
RE: home backup files vanish - alcina - 17th Apr, 2021, 07:16 PM
RE: home backup files vanish - Nachteule - 17th Apr, 2021, 08:26 PM
RE: home backup files vanish - alcina - 17th Apr, 2021, 11:39 PM
RE: home backup files vanish - Nachteule - 18th Apr, 2021, 12:37 AM
RE: home backup files vanish - alcina - 18th Apr, 2021, 03:33 AM
RE: home backup files vanish - Nachteule - 18th Apr, 2021, 04:14 AM
RE: home backup files vanish - alcina - 27th Apr, 2021, 06:13 PM
RE: home backup files vanish - Nachteule - 28th Apr, 2021 09:25 PM
RE: home backup files vanish - alcina - 29th Apr, 2021, 02:55 AM
RE: home backup files vanish - Nachteule - 13th May, 2021, 11:14 PM
|