The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-03-2007
livetele livetele is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 4
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0