Sample Header Ad - 728x90

FTP: get the latest file in server

2 votes
2 answers
4599 views
I have an ftp server running, and it irregularly generates the latest file. The file is store as: Home->T22:30:10->new.txt, and the latest one would be (a new folder) Home->T23:10:25->new.txt (note that this is a new folder with latest time) I need to implement something (it could be anything, C code, Bash script, etc.) in a Linux machine that pulls the latest file over. I have looked into two options: 1. Use libcurl, pass the directory listing, and select the latest file. This is really annoying ass and time-consuming, and I still can't find a easy way to do this. 2. Use lftp, at initiazation, remove all the files in the server, so that each time when I call lftp to download something, it would be the latest one. (This method is only conceptual and I haven't tried it in real life). Is there any easier option?
Asked by andy_ttse (707 rep)
Mar 25, 2015, 04:21 PM
Last activity: Jan 30, 2024, 11:28 PM