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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how can i pick the latest log file as per below mail2sant Shell Programming and Scripting 4 04-05-2009 01:14 AM
get latest file inquirer Shell Programming and Scripting 4 04-02-2009 11:15 AM
Getting latest file from ftp arunavlp UNIX for Dummies Questions & Answers 3 02-08-2008 10:19 AM
get latest file via ftp command alx Post Here to Contact Site Administrators and Moderators 2 01-26-2006 11:44 AM
want to cat the latest log file created vkandati UNIX for Dummies Questions & Answers 1 03-08-2005 06:13 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 05-13-2008
laiko laiko is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 8
ftp command to get latest file

Hi,
I would like an FTP command or series of commands to get only the latest file. Is that possible?
Thanks in advance.
  #2 (permalink)  
Old 05-13-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 921
You can use expect and send commands to script an interaction with your ftp client (assuming it's commandline).
Using these commands, open your ftp session, find the correct directory, then run a listing sorted by date.
Use your script to get the last (or first) line of this output and then use it to issue an ftp get for that file.

Alternativly, perl's ftp module is pretty good, you can use that to obtain an array sorted by date of the files in a given directory, then grab the appropriate entry and send the get requiest via perl too.
  #3 (permalink)  
Old 05-14-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Some advanced ftp clients have their own little scripting languages. Maybe look at lftp and/or ncftp (it's been years, not at all sure what those offer in their recent versions).
Sponsored Links
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 04:44 PM.


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