Script to check file update on ftp server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to check file update on ftp server
# 1  
Old 02-16-2009
Script to check file update on ftp server

Hi everybody,

Is there a way to do a stat of files on a ftp server? I have a database which is populated by the contents of these files. I want to setup a crontab to check if there has been an update to these files. If the file has been updated I will download it and then update my database.

I want to know of a way to compare my local files with the files on the server. I don't want to download them and then check since they are quite big.

Thanks in advance,

Dave

-------------------------

Update: wget -N <URL>
seems to do the job.

Last edited by z1dane; 02-17-2009 at 12:55 AM.. Reason: Found a solution
# 2  
Old 02-17-2009
Check out the Perl FTP module. Look for mdtm() method.
# 3  
Old 02-17-2009
Cheers mate!

I had originally written a Perl script using the Net::FTP module, but used the size() method. The mdtm() method makes much more sense.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

FTP script to get latest file from server

Hello people, I have to download, with a scheduled script, the latest file from an FTP server. In the remote DIR, named .../TEKNONET/60468/, every night a CDR file like this gets uploaded into it: 000006046820151122N001.CDR, so my script will have to download every day the previous day... (12 Replies)
Discussion started by: virtus96
12 Replies

2. Shell Programming and Scripting

Update/Download file from FTP server to UNIX Server

HI Guys, I want to download files from FTP Server to my Unix server. I have tried , buy No Luck . Below Command i have tried. 1-Wget - Error "wget' not found" 2.ftp -n $HOST ...Not Working. 3.scp -i ftp://user:passowrd@hostname:21/ran/on/test.txt Any Suggestion (2 Replies)
Discussion started by: pareshkp
2 Replies

3. Shell Programming and Scripting

Check the space in ftp server

i am connected to the ftp server. how to check the space in that server. what is the command to check in the below command prompt ftp> ftp> (1 Reply)
Discussion started by: ramkumar15
1 Replies

4. Shell Programming and Scripting

Shell script to read from a file and update remote server

Its a tough one and would appreciate any guidance for a script that i am trying to develop....Again I do understand its a complicated script and help would be greatly appreciated.... Thank you 1- Need to check for a file (in a certain location on a server) every 15 minute or so if it is there... (4 Replies)
Discussion started by: aavam
4 Replies

5. Shell Programming and Scripting

Script to upload latest file to other server via FTP

Hello, I have a script that finds the latest version of a file in a folder on my Minecraft server. I'm trying to come up with something that will then FTP that file over to my fileserver. Here's what I have that finds the newest file: find /home/mc/archive/sbhouse -type f -mtime +45 -exec... (7 Replies)
Discussion started by: nbsparks
7 Replies

6. Shell Programming and Scripting

need to check the file using ftp in a shell script

i need to write a shell script.. connecting to another server using ftp and check whether the file ter.txt is exists there or not. i have written scirpt partially,as i new to Unix. ftp -inv $FTPHOST > $TEMPFILE1 2> $TEMPFILE1 << EOF user $FTPUSER $FTPPW binary prompt ${CD} ls *.txt... (11 Replies)
Discussion started by: KiranKumarKarre
11 Replies

7. Shell Programming and Scripting

Contantly check for file at the remote server and ftp when avaliable

Hello, I used the search engine but could not find the solution I am looking for. Probably its simple but I do not know the solution. My requirement is I ftp files every day in the morning from the remote server to the local machine. Now if the files are not there at the time I schedule the ftp... (2 Replies)
Discussion started by: kiran_418
2 Replies

8. Shell Programming and Scripting

How check for a new file on a ftp-server

Hi there, I want to write a linux shellscript that checks a specific folder on a specific FTP-server whether there are new files or not. If there are new files I want to download them to a local directory (to gain access for an local application to these files). The problem is that the files I... (3 Replies)
Discussion started by: monstrous
3 Replies

9. Shell Programming and Scripting

Shell script for FTP a file from one server to another server

Hi Can any one help me for script. I need a script and this script has to execute daily to move the files. FTP from one server to another server EX: Sep 10 06:24 abc.txt Sep 11 06.56 abc.txt Sep 12 08.23 abc.txt these files are located at a/b/c/e/f in 123 server and copy... (0 Replies)
Discussion started by: mahantysk
0 Replies

10. Shell Programming and Scripting

how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this? thanks in advance! Im a newbie to this... (4 Replies)
Discussion started by: forevercalz
4 Replies
Login or Register to Ask a Question