Skip to content

Commit 7edeb11

Browse files
committed
workaround for talky ftp
1 parent 4a34f94 commit 7edeb11

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bin/v-add-backup-ftp-host

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
2323

2424
# Defining ftp command function
2525
ftpc() {
26-
/usr/bin/ftp -n $host $ftp_port <<EOF
26+
ftp -n $host $ftp_port <<EOF
2727
quote USER $ftp_user
2828
quote PASS $ftp_password
2929
binary
@@ -48,7 +48,8 @@ validate_format 'host' 'ftp_user' 'ftp_password'
4848
#----------------------------------------------------------#
4949

5050
# Checking network connection
51-
if [ ! -z "$(ftpc)" ]; then
51+
ftp_connect=$(ftpc)
52+
if [ ! -z "$(echo $ftp_connect |grep -i -e error -e 'not connected')" ]; then
5253
echo "Error: can't login to ftp"
5354
log_event "$E_CONNECT" "$EVENT"
5455
exit $E_CONNECT
@@ -60,7 +61,7 @@ ftmpdir=$(mktemp -u -p "$ftp_path")
6061
ftp_result=$(ftpc "mkdir $ftmpdir" "rm $ftmpdir")
6162
if [ ! -z "$ftp_result" ] ; then
6263
rm -rf $tmpdir
63-
echo "Error: can't create temp folder on the ftp"
64+
#echo "Error: can't create temp folder on the ftp"
6465
log_event "$E_FTP" "$EVENT"
6566
exit $E_FTP
6667
fi

bin/v-backup-user

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ ftp_backup() {
556556
echo -e "$(date "+%F %T") FTP ftp://$HOST$BPATH/$user.$DATE.tar"
557557

558558
# Checking ftp connection
559-
if [ ! -z "$(ftpc)" ]; then
559+
ftp_connect=$(ftpc)
560+
if [ ! -z "$(echo $ftp_connect |grep -i -e error -e 'not conn')" ]; then
560561
rm -rf $tmpdir
561562
echo "Can't login to ftp://$USERNAME@$HOST" |\
562563
$send_mail -s "$subj" $email

0 commit comments

Comments
 (0)