Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Looping through files to ftp
Name: cleininger Date: February 5, 2007 at 12:52:03 Pacific OS: Unix CPU/Ram: P4 / 1 GIG Product: home burger
Comment:
I wrote an ftp shell script that ftp's everything in a particular dir using mput *
Instead of blindly ftp'ing every file in the directory, I want to:
1. ftp a file 2. mv that file to a archive folder 3. delete the file from the source folder 4. repeat 1-3 with the next file(s) 5. repeat until dir is empty
Can someone be able to post some code examples on how to do this?
Name: thepubba1 Date: February 6, 2007 at 08:23:29 Pacific
Reply:
for file in * do {your ftp code here substituting "put $file' in place of "mput *'} mv $file /mydir if [[ $? -eq 0 ]] then rm $file else print "Error moving $file" exit 1 fi done
Summary: hi all, This is regarding ksh script. I have a ftp script which does fine job in copying files to remote server. But i still have a small problem to solve. Directories are been created in the ser...
Summary: Hello all, I have a directory containing a files. I need a function which loops through the directory and greps 2 attributes out of the files. The file looks like: Name='Eric' FMASK='^Eric_1' The func...
Summary: How do i send using ftp or by any method to send unix file to local drive(i.e c:\) from UNix command line and vice versa. my requirement is to pull the files from the UNix adnd format usinga tool whic...