Skip to content

Instantly share code, notes, and snippets.

@bet02024
Created June 3, 2013 19:23
Show Gist options
  • Save bet02024/5700610 to your computer and use it in GitHub Desktop.
Save bet02024/5700610 to your computer and use it in GitHub Desktop.
#!/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
@bet02024
Copy link
Author

bet02024 commented Jun 3, 2013

FTP Shell for send all files (except the most recent) in a Directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment