republican-creole
site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
424
Share Topic
Posting?
Post a:
Post a:
Links: ·Forum FAQ ·Attitude Adjustment ·Linux docs ·DistroWatch ·OPLM ·FreeBSD Handbook
AuthorAll Replies


Poornima

@troweprice.com

Regarding moving files from FTP site to some other folder

Hi,
I am new into Unix and I have 2 files A & B coming into my FTP site on 2nd day of all months.
The files are in the format
A_YYMMDD_HHMISS Ex: A_081102_180708

I need to rename the filenames to Product & Person and push to some other machine.Also the files won't be deleted after moving from FTP site.So all files will be accumulated in the same folder of FTP site.Can anyone help me in doing the Korn shell script for the same?

Thanks a lot,
Poornima


Sir Meowmix III

@205.255.240.x

Look at using ncftpget and ncftpput

ncftpget ftp.mysite2.com /tmp `date +A_%y%m%d_%H%M%S`
mv -f /tmp/`date +A_%y%m%d_%H%M%S` 'Product & Person'
ncftpput ftp.mysite2.com /path/to/upload '/tmp/Product & Person'
 


Sir Meowmix III

@205.255.240.x

reply to Poornima

mv -f /tmp/`date +A_%y%m%d_%H%M%S` 'Product & Person' 
 

Should read as:

mv -f /tmp/`date +A_%y%m%d_%H%M%S` '/tmp/Product & Person' 
 


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL

reply to Poornima
Another tool that may be useful if these file come in at somewhat predictable intervals is cron. You can take the Sir Meowmix III's script and save it as a simple text file with a .sh extension and then have cron run this at the intervals.
cron is a scheduler that runs a certain command at a given interval. Type the following in a command line to learn more:
man cron
man crontab
Or read those files at »manpages.ubuntu.com/manpages/int···ron.html and »manpages.ubuntu.com/manpages/int···tab.html These are Ubuntu's man pages, your version of Unix may have different info, but the overall usage should be similar or identical so Ubuntu's man pages are probably valid for your distro to.
--
"Padre, nobody said war was fun now bowl!" - Sherman T Potter

»www.cafepress.com/maxolasersquad

»maxolasersquad.com/

»maxolasersquad.com/network/ My DSL Network Guide

»myspace.com/mlsquad



Poornima

@troweprice.com

reply to Poornima
Thanks a lot Friends!!



Poornima

@troweprice.com

reply to Poornima
Hi,
While executing the above script, I am getting a warning " ncftpget: not found".Does any inputs on this?



Sir Meowmix III

@windstream.net

reply to Poornima
You must install ncftp. I have no idea what variant of UNIX you are using so I cannot comment with any specific instructions.


Friday, 01-Jun 05:43:01 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 12.5 years online © 1999-2012 dslreports.com.
Most commented news this week
Hot Topics