I have a problem with a script that I am trying to write.
Ideally, the script should compress the folders and then send the zipped files to the ftp server creating the folder as the name of the zipped file (without extension) but it's not working correctly quite yet, what am I doing wrong ?
Hi, the manually executed script returns this error
mirror: Access failed: 530 Access denied (.zip)
I would like to send the files that zipped to the ftp server, what should I change? Thank you
#!/bin/sh
HOST=""
USER=""
PWD=""
FILESIZE="$(du -sm $1 | cut -f1)"
ZIPNAME="$(basename $1)"
REMOTEFOLDER="$(dirname $1)"
if [ $FILESIZE -ge 1500 ]
then
7z a -v1400m $REMOTEFOLDER/$ZIPNAME.zip $1
else
7z a $REMOTEFOLDER/$ZIPNAME.zip $1
fi
lftp ftp://$USER:$PWD@$HOST -e "set ssl:verify-certificate no; mirror -R -r -i '$ZIPNAME.zip*' $REMOTEFOLDER /$REMOTEFOLDER; quit"
lftp
command return any errors? What happens differently if you attempt to run thelftp
part manually instead?ps axe
at a later date as it's probably not germane to the reason why your script isn't working.sh -x
. This will echo each command before it's executed, and may help catch quoting errors. Perhaps what you think it's sending isn't quite what's going on.