![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| scp automated script | gholdbhurg | UNIX for Advanced & Expert Users | 4 | 06-26-2008 05:47 PM |
| Automated shtudown | joe1967 | Shell Programming and Scripting | 5 | 05-29-2007 05:04 PM |
| automated ftp. | sangfroid | Shell Programming and Scripting | 10 | 05-07-2007 08:52 AM |
| FTP automated? | n9ninchd | UNIX for Dummies Questions & Answers | 6 | 05-18-2001 07:21 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
My requiremnet is to write a FTP script which will ftp a file to a specified ftp url.
How can I automate the process usnig the unix cron. |
| Forum Sponsor | ||
|
|
|
|||
|
Try something like this for the ftp script:
#!/usr/bin/ksh ftp -v -n "YOUR.IP.ADD.RESS" << cmd user "user" "passwd" cd /distant/directory lcd /local/directoryget ssh_install get ( or put) your files quit cmd All you have to do after is to create the cron Will that help? Jason |
|
|||
|
How can we get the exit status of this script so that we know if the ftp was successful? echo $? always returns 0 in this or similar script. I have a similar script which uploads a file to an ftp site but the exit status always returns true whether the file to be uploaded exists or not.
|
|
|||
|
You can write a smilar FTP script.
if you are "putting" a file, replace the put with ls and see if your file is in there. if you are "getting" a file, search for the file in your local directory and you can then know if the FTP was successfull or not. |
|
|||
|
Thanks all..
even I was looking for automatic FTP and it worked for me too. however I still have one problem as how can I FTP all directories with thier respective sub-directories between two hosts. Its possible as of now but the structer of the directory has to be existing before, so that FTP can put all the files in their respective sub-directories by saying "mget *". But if the directory structure does not exists then FTP "mget *" command only gets files from home to home and not sub-directories and the files existing in the respective sub-directories. can you all please help ? is there any way ? Thanks and Regards Taher |
|||
| Google UNIX.COM |