dobackup: collect errors instead of failing, show them at end
This commit is contained in:
parent
c067ed87f9
commit
19db27d6bf
11
dobackup
11
dobackup
|
@ -30,6 +30,9 @@ source $1
|
|||
|
||||
timestamp=`date +"%Y%m%d-%H%M"`
|
||||
dest="$HOME/backups/$name-$timestamp"
|
||||
errfile="$name-$timestamp.errs"
|
||||
|
||||
touch errfile
|
||||
|
||||
if [ "$remote" = true ]; then
|
||||
if [ -z "$sshUserHost" ]; then
|
||||
|
@ -48,12 +51,10 @@ eval ${precommand}
|
|||
for file in $files; do
|
||||
fullcommand="$command$file $dest"
|
||||
echo "$fullcommand"
|
||||
if [ "$remote" = true ]; then
|
||||
$fullcommand
|
||||
else
|
||||
$fullcommand || exit 1
|
||||
fi
|
||||
$fullcommand 2>>"$errfile"
|
||||
done
|
||||
|
||||
echo "$postcommand"
|
||||
eval ${postcommand}
|
||||
|
||||
cat "$errfile"
|
||||
|
|
Loading…
Reference in New Issue
Block a user