#!/bin/sh
HOST='ftp.example.com'
USER='ftpuser'
PASSWD='P@ssw0rd'
FOLDERNAME=$(date +%d%b%Y)
LOCALPATH='/localpath/'
DIR='/ftp_foldername/'
ftp -inv $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
cd $DIR
mkdir $FOLDERNAME
cd $FOLDERNAME
lcd $LOCALPATH/$FOLDERNAME
mput *
quit
END_SCRIPT
exit 0
HOST='ftp.example.com'
USER='ftpuser'
PASSWD='P@ssw0rd'
FOLDERNAME=$(date +%d%b%Y)
LOCALPATH='/localpath/'
DIR='/ftp_foldername/'
ftp -inv $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
cd $DIR
mkdir $FOLDERNAME
cd $FOLDERNAME
lcd $LOCALPATH/$FOLDERNAME
mput *
quit
END_SCRIPT
exit 0
0 comments:
Post a Comment