Update backup.sh

This commit is contained in:
Pavel Dmitriev 2021-11-02 12:10:54 +03:00 committed by GitHub
parent b0d00934e5
commit 8b57aa2a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -106,13 +106,15 @@ rm -f $prefix/$stamp/*
rmdir $prefix/$stamp rmdir $prefix/$stamp
# Sending data # Sending data
if [ -n "${sshhost}" ]
for xfile_item in `ls ${prefix}/compressed` then
do for xfile_item in `ls ${prefix}/compressed`
scp -B -i ${sshkey} ${prefix}/compressed/${xfile_item} ${sshuser}@${sshhost}:${sshpath} > /dev/null do
if [ "$?" == 0 ] scp -B -i ${sshkey} ${prefix}/compressed/${xfile_item} ${sshuser}@${sshhost}:${sshpath} > /dev/null
then if [ "$?" == 0 ]
rm -f ${prefix}/compressed/${xfile_item} then
fi rm -f ${prefix}/compressed/${xfile_item}
done fi
done
fi