workaround for talky ftp

This commit is contained in:
Serghey Rodin 2013-10-10 12:57:16 +03:00
commit 7edeb110b6
2 changed files with 6 additions and 4 deletions

View file

@ -556,7 +556,8 @@ ftp_backup() {
echo -e "$(date "+%F %T") FTP ftp://$HOST$BPATH/$user.$DATE.tar"
# Checking ftp connection
if [ ! -z "$(ftpc)" ]; then
ftp_connect=$(ftpc)
if [ ! -z "$(echo $ftp_connect |grep -i -e error -e 'not conn')" ]; then
rm -rf $tmpdir
echo "Can't login to ftp://$USERNAME@$HOST" |\
$send_mail -s "$subj" $email