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
# Sending data
for xfile_item in `ls ${prefix}/compressed`
do
scp -B -i ${sshkey} ${prefix}/compressed/${xfile_item} ${sshuser}@${sshhost}:${sshpath} > /dev/null
if [ "$?" == 0 ]
then
rm -f ${prefix}/compressed/${xfile_item}
fi
done
if [ -n "${sshhost}" ]
then
for xfile_item in `ls ${prefix}/compressed`
do
scp -B -i ${sshkey} ${prefix}/compressed/${xfile_item} ${sshuser}@${sshhost}:${sshpath} > /dev/null
if [ "$?" == 0 ]
then
rm -f ${prefix}/compressed/${xfile_item}
fi
done
fi