Commit dbd8c4f3 authored by Fjen Undso's avatar Fjen Undso
Browse files

fix ftpdelete

parent c326a97b
...@@ -132,6 +132,7 @@ else ...@@ -132,6 +132,7 @@ else
fi fi
### FTP: delete old backups ### FTP: delete old backups
echo "### Delete old backups on FTP..."
ftpfiles=$(execftp "cd $FTPDIR; nlist; exit") ftpfiles=$(execftp "cd $FTPDIR; nlist; exit")
# filter files starting with a dot # filter files starting with a dot
ftpfiles=( $(echo $ftpfiles | sed 's,\.[A-Za-z0-9_\/\.]* , ,g') ) ftpfiles=( $(echo $ftpfiles | sed 's,\.[A-Za-z0-9_\/\.]* , ,g') )
...@@ -143,7 +144,7 @@ else ...@@ -143,7 +144,7 @@ else
done done
# delete on ftp # delete on ftp
[ ${#ftpfilesdelete[@]} -ge 1 ] \ [ ${#ftpfilesdelete[@]} -ge 1 ] \
&& ftpfilesdelete=${ftpfilesdelete[@]} \ # lftp has problems with arrays && ftpfilesdelete=${ftpfilesdelete[@]} \
&& execftp "cd $FTPDIR; rm -r $ftpfilesdelete; exit" && execftp "cd $FTPDIR; rm -r $ftpfilesdelete; exit"
### FTP: upload ### FTP: upload
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment