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 > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Batch file to Get New Files Only through FTP alsharq Windows & DOS: Issues & Discussions 1 03-29-2009 01:08 PM
bash - batch script for extracting one file from multiple tar files kuliksco Shell Programming and Scripting 4 11-13-2007 02:34 AM
Looping/Repetition in Batch files kimpot7268 Shell Programming and Scripting 2 12-12-2005 08:45 AM
Schedule a Batch file to delete files at particular intervals Indom Windows & DOS: Issues & Discussions 6 02-04-2004 12:57 PM
Batch files and FTP under Unix ober5861 UNIX for Dummies Questions & Answers 4 07-16-2001 09:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-29-2009
alsharq alsharq is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 2
Exclamation Batch file to Get New Files Only through FTP

Hi there

I want to create a batch file which Get (mget) the newly added Files only from specific directory on UNIX server to specific folder on windows server using FTP, and this batch file will be scheduled on the windows server to run daily to load the new files (load the newly added files from the unix directory to the windows folder).
Urgent help plz

I have reached the following

1- The following is the batch file it contains the following:

Code:
ftp -n -s:ftp_import.txt 10.32.253.73
exit
2- The following is the text file which has the name "ftp_import.txt". it contains the following:

user <unix username>
<unix password>
lcd D:\(The path of source, where to get the files from unix server)
cd /home/The path of destination, where to put the files to windows server)
prompt
mget *.CSV
bye


Everything is running well

But still I want to modify this batch to get only the newly added CSV files, not all the files (*.CSV). this is now my only problem.

Last edited by Yogesh Sawant; 03-29-2009 at 12:57 PM.. Reason: added code tags
  #2 (permalink)  
Old 04-03-2009
eskiphill4 eskiphill4 is offline
Registered User
  
 

Join Date: Oct 2008
Location: Pacific Northwest
Posts: 12
A variation on the approach I use may meet your needs. The first call to FTP needs to do a DIR and save the result to the local disk. The script then parses that file to identifiy what files are new. The second call to FTP downloads specific files that were identified as new. I tend to do this sort of stuff with PERL instead of a batch file. Much better control that way.
Closed Thread

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:42 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