Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP SCRIPT in Unix

Status
Not open for further replies.

Evette

Programmer
May 10, 2002
9
US
I want to create a script that will automatically transfer the latest file created from one server to another. This will be run as a cron job daily. This is basically what I have. Am I on the right track? Need your help.

#!/bin/ksh
ftp servername <<+
Username=user
Password=password
cd /directory where file is located
#find the file the last file created
ll > d.file
lastfile=`grep charge d.file|awk '
{
if($16 > lf)
lf=$16
} END
get file
send to remote server
echo $lastfile

Thanks
Evette
 
look: thread822-350768
------------ jamisar
Einfachheit ist das Resultat der Reife. (Friedrich Schiller)
Simplicity is the fruit of maturity.
 
check out the folowing FAQs

faq80-965
faq80-772

vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top