![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| automated ftp. | sangfroid | Shell Programming and Scripting | 10 | 05-07-2007 11:52 AM |
| process vs task | hana | UNIX for Dummies Questions & Answers | 2 | 07-02-2006 06:32 PM |
| Automated FTP | shauche | UNIX for Advanced & Expert Users | 11 | 07-11-2002 02:08 AM |
| FTP automated? | n9ninchd | UNIX for Dummies Questions & Answers | 6 | 05-18-2001 10:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
Quote:
|
|
|||||
|
I managed to get it working by adding this function.
Code:
cleanup ()
{
echo "=======================================" >> $LOG2
echo "== Cleaning up old sent files ==" >> $LOG2
echo "=======================================" >> $LOG2
echo " Files removed from $LHOST:$LOUT/.sent" >> $LOG2
## Clean up local servers Outgoing folder
cd $LOUT/.sent
find $LOUT/.sent -mtime +14 >> $LOG2
find $LOUT/.sent -mtime +14 -exec rm {} \;
## Create the .history folder
cat /dev/null > $LIN/.history/.list
cd $LIN
for history in `ls` ; do
touch $LIN/.history/$history
done
exec 4>&1
ftp -n >&4 2>&1 |&
pid5=$!
print -p open $RHOST
print -p user $USER $PASSWD
print -p binary
print -p cd $ROUT/.sent
cd $LIN/.history
find $LIN/.history -mtime +14 >> $LIN/.history/.list
for old in `cat $LIN/.history/.list` ; do
print -p delete $old # Delete file from remote server
rm $old # Delete file from local folder
done
print -p bye
wait $pid5
echo " Files removed from $RHOST:$ROUT/.sent" >> $LOG2
cat $LIN/.history/.list >> $LOG2
echo "" >> $LOG2
}
Last edited by Tornado; 10-08-2007 at 06:07 PM.. |
|
||||
|
Hi,
I tried the ftp program in cygwin and was not able to execute it. It shows error -------------------------------------------- nortel_admin@TCS036694 /usr/local/bin $ ksh ftpsh ftpsh: 9: Syntax error: "&" unexpected nortel_admin@TCS036694 /usr/local/bin $ -------------------------------------------- basically it refers to line ************************* exec 4>&1 ftp -nv >&4 2>&4 | & ************************* Please advice... Regards, Sujit Menon |
|
|||||
|
Quote:
$ ksh ftpsh try $ exec ksh $ ftpsh |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| linux, mtime, sendmail |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|