![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems with cut | scorpio | Shell Programming and Scripting | 6 | 04-28-2008 09:49 AM |
| NIS+ problems | wjones | UNIX for Advanced & Expert Users | 0 | 04-09-2008 06:30 AM |
| RCP problems | Daishi | UNIX for Dummies Questions & Answers | 0 | 09-10-2007 06:20 AM |
| gcc problems | AJA | SUN Solaris | 7 | 03-09-2004 10:44 AM |
| 'make' problems (compliation problems?) | xyyz | UNIX for Advanced & Expert Users | 5 | 11-05-2001 10:47 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
FTP problems
Hi All, I am ftping to a windows box where i will be going to a specific directory and check whether file is existing or not. If file exists, get the file to my UNIX box else, say that file didn't exist and touch a new file in UNIX box. Here is what i tried the code: This is FTP script. Code:
ftp -n <<EOF open windowsboxname user --> User credintials. cd FTPT1 pwd ls #Somewhere over here i need to check the file existance. If true get the file else touch #a new file, get $2 $1/"$2" rename $2 Archive/`date '+%Y_%m_%d'`"_"$2 quit EOF $2 is the file. I am not sure where to include the code in such a way that the new file will be created if file doesn't exist. Thanks in advance. |
|
||||
|
One suggestion is to use two ftp sessions
- first one is used to just get the "ls" on the remote machine & check the existance of filename in the list and display if it not exists. - second session will be executed only if the list generated in the first list contain the filename. then do the "get" of teh required files. |
|
||||
|
Quote:
Many thanks for the reply. I will give it a try. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|