![]() |
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 |
| 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 |
| Sun's 'Project Copy Linux' not a Linux copy - Register | iBot | UNIX and Linux RSS News | 0 | 07-29-2007 05:31 AM |
| help need on ncftp | livetele | Shell Programming and Scripting | 2 | 02-05-2007 11:38 AM |
| Is ncftp possible between two SCO Unix servers? | hrishi10a | SCO | 0 | 09-04-2006 05:39 AM |
| Help with Copy Move Script | alfpathros | Shell Programming and Scripting | 4 | 05-11-2004 08:52 AM |
| how to copy/move folder on XP to Solaris? | simt | UNIX for Dummies Questions & Answers | 2 | 07-28-2003 12:01 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
ncftp copy/move pb
Hi,
i have made this script for copy file in folder FTP in my local machine, when copy is finish i move files copied in backups_001 directory on same ftp 1°) the problem is if this script works with date if date is similar i taken, but if one day in ftp they put new file is no getting example : if i run script today : ABMOTORS_020507.txt --> ok is taken now if i run my script 04-05-2007 ABMOTORS_030507.txt --> ok is taken but if ppl put another files in middle of journey how i can LOOKS and taken this files i have put my script in crontab ( 08h00 morining - and 14h00 afternoon ) 2°) How copy/move multipe files in FTP ???? Code:
#!/bin/ksh # INFO FTP HOST='xxx.xxx.xxx.xxx' USER='MY_LOGIN' PASSWD="MY_PWD" # date of day -1 TA=$(TZ=GMT+24 /usr/bin/date +%d%m%Y) # Date today TB=$(TZ=GMT+12 /usr/bin/date +%d%m%Y) # Start FTP Connection ncftp -u "$USER" -p "$PASSWD" $HOST<<END_SCRIPT cd OUT_1 mget **ABMOTORS_$TA*.txt** **ABFAKE_$TA.txt** **ABSAVES_$TA*.txt** **ABSOLUTION_$TA.txt** rename ABMOTORS_$TA*.txt ../BACKUPS_001/ABMOTORS_$TA*.txt rename ABFAKE_$TA.txt ../BACKUPS_001/ABFAKE_$TA.txt rename ABSAVES_$TA*.txt ../BACKUPS_001/ABSAVES_TA*.txt rename ABSOLUTIONS_$TA.txt ../BACKUPS_001/ABSOLUTIONS_$TA.txt cd .. cd OUT_2 mget **UZOPPER_$TA.txt** rename UZOPPER_$TA.txt ../BACKUPS_002/UZOPPER_$TA.txt P.S: system Solaris |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|