The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Grepping the last 30 minutes of a log file... jtelep Shell Programming and Scripting 2 03-05-2008 09:27 PM
Script to move certain number of files every 10 minutes. amitsayshii UNIX for Dummies Questions & Answers 1 02-26-2007 01:55 AM
Issue with setup.hp file for webserver vishalm HP-UX 1 12-21-2006 05:45 PM
get last 5 minutes' log from log file? fedora Shell Programming and Scripting 5 07-19-2006 01:49 PM
Convert minutes to hours, minutes, seconds Vozx Shell Programming and Scripting 1 12-08-2005 10:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-10-2008
Bradj47's Avatar
Registered User
 

Join Date: Feb 2008
Posts: 19
How can I move a file to a webserver every 5 minutes?

I'm using Ubuntu and I have a text file I want to FTP to a web server every 5 minutes. I want to overwrite the existing file every time so I don't have tons of the same file.
Reply With Quote
Forum Sponsor
  #2  
Old 07-11-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
For scheduling the file's transfer use cron manager, or whatever is available under Ubuntu. For the FTP transfer - what have you done so far ? Should this task be script, if yes, what language you have knowledge in ? Else, you can always look at the forum's base, there are many examples on how to automate file transfer via shell script for example.
Reply With Quote
  #3  
Old 07-14-2008
jhtrice's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 63
Some ftp servers are set up not to allow this or put version numbers on files that already exist. Check with the admin of the ftp server.
Also, be nice and write your script to only transfer the file if it has changed. I have a client who thinks it's just peachy to ftp me 5,000 files several time every day, always the same files.
Reply With Quote
  #4  
Old 07-14-2008
Ikon's Avatar
Registered User
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 414
try putting this in cron to run every 5 mins.

this should work:

wget ftp://usernameassword@someserver/somefile -O /where/to/put/the/file/filemane.ext
Reply With Quote
  #5  
Old 07-15-2008
Registered User
 

Join Date: Jun 2008
Posts: 30
If you don't want to mess with crontab, just write a shell script that does and infinite loop with sleep(5m) inside it followed by the wget/ftp command to put the file there.
Reply With Quote
  #6  
Old 07-18-2008
ynilesh's Avatar
Registered User
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 174
1. keep your script running continuously is not a good option. Let cron do that.
2. but yes create a script which will take a backup of your existing file. then remove old one and copy new one.
3. Also keep check in script if it has been copied properly on remote server. you can use md5sum to check that.

- $nilesh
Reply With Quote
  #7  
Old 07-18-2008
Registered User
 

Join Date: Jun 2008
Posts: 30
Quote:
Originally Posted by ynilesh View Post
1. keep your script running continuously is not a good option. Let cron do that.
Why isn't it a good option?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
file, ftp, linux, server, solaris, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0