![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script for FTPing files to mainframe GDG | dsrookie | UNIX for Dummies Questions & Answers | 1 | 03-13-2008 06:32 AM |
| removing old files except configuration files and folders | jamcalicut | Shell Programming and Scripting | 1 | 11-09-2007 01:34 PM |
| removing files | luft | UNIX for Dummies Questions & Answers | 8 | 03-21-2007 09:53 AM |
| FTPing backup files to another server | fredlucas3 | UNIX for Dummies Questions & Answers | 10 | 11-12-2002 08:40 AM |
| Removing Files | Blondie | UNIX for Dummies Questions & Answers | 5 | 07-17-2001 03:30 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
removing files after ftping
Hi All,
I'm trying to write script to ftp some files and then need to remove these files from server. Is there any way to keep the condition that the file should be removed only after successfully transfered to the destinatino server? If in case, the file isn't been transferd, it should not be removed. Thanks in advance. Regards, im_new |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Can anyone plz help/advise?
|
|
#3
|
|||
|
|||
|
did you try to check the status of transfer using '$?' ?
|
|
#4
|
|||
|
|||
|
Hi manikantants,
I'm dealing with ftp for the first time. I'm not sure how this status check is done? Can u plz let me know.. Even, I'll try to search for it. Thanks |
|
#5
|
|||
|
|||
|
'$?' will give the exit status of previous command.
So in case of ftp also you can check this exit status. If it is not equal to zero, that means ftp was not successfull. following lines may help you. I haven't tested this. Please test it properly before using. ftp -n 255.255.255.255 << EOF user username password put filename bye EOF if [ $? -eq 0 ] then #do the required on successfull transfer else #do the required on failure fi |
|
#6
|
|||
|
|||
|
Thanks a ton!!!
|
|||
| Google The UNIX and Linux Forums |