Created
June 3, 2013 19:23
-
-
Save bet02024/5700610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PATHDIR='/Users/beto/Downloads/test' | |
cd $PATHDIR | |
ftpSvr () { | |
HOST='67.222.130.110' | |
USER='XXXX' | |
PASSWD='XXXX' | |
ftp -n $HOST <<END_SCRIPT | |
quote USER $USER | |
quote PASS $PASSWD | |
bin | |
put $1 | |
quit | |
END_SCRIPT | |
} | |
NUM=$( ls -t $PATHDIR | wc -l ) | |
I=1 | |
echo $NUM | |
for f in `ls -tr $PATHDIR`; do | |
if [ $I -lt $NUM ]; then | |
echo "Sending File $f ...." | |
ftpSvr $f | |
I=`expr $I + 1` | |
rm $f | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FTP Shell for send all files (except the most recent) in a Directory.