1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#!/bin/bash cd /var/ericsson/nin/charging/archive date=`(/usr/bin/perl -e '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time()-24*60*60);printf "%4d%02d%02d", $year+1900,$mon+1,$mday;')` movedFile=`ls | grep $date` HOST=xxxx USER=xxxx PASSWD=xxxxx for i in $movedFile; do echo $date >> trial.txt echo "Uploading file $i" >> trial.txt ftp -n $HOST quote USER $USER quote PASS $PASSWD binary cd TEMP put $i quit END_SCRIPT echo "kk" done |