How can I move a file to a webserver every 5 minutes?


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu How can I move a file to a webserver every 5 minutes?
# 1  
Old 07-10-2008
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.
# 2  
Old 07-11-2008
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.
# 3  
Old 07-14-2008
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.
# 4  
Old 07-14-2008
try putting this in cron to run every 5 mins.

this should work:

wget ftp://usernameSmilieassword@someserver/somefile -O /where/to/put/the/file/filemane.ext
# 5  
Old 07-15-2008
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.
# 6  
Old 07-18-2008
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
# 7  
Old 07-18-2008
Quote:
Originally Posted by ynilesh
1. keep your script running continuously is not a good option. Let cron do that.
Why isn't it a good option?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

rsync a file as it gets created and after 3 minutes old

- run a backup job - The jobs creates partial files one after the other, about 2 minutes interval. What i want to do is that while the job is still running or while a file was last modified or created 3 minutes ago, the file should be rsync to a remote server untill the last file has been... (4 Replies)
Discussion started by: malaika
4 Replies

2. Shell Programming and Scripting

Check file creation Time minutes and if file older then 5 minutes execute some stuff

Hello all, Info: System RedHat 7.5 I need to create a script that based on the creation time, if the file is older then 5 minutes then execute some stuff, if not exit. I thought to get the creation time and minutes like this. CreationTime=$(stat -c %y /tmp/test.log | awk -F" " '{ print... (3 Replies)
Discussion started by: charli1
3 Replies

3. Shell Programming and Scripting

Grep a log file for the last 5 minutes of contents every 5 minutes

Hi all, System Ubuntu 16.04.3 LTS i have the following log INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042 INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Discussion started by: charli1
15 Replies

4. UNIX for Beginners Questions & Answers

How to convert days hours minutes seconds to minutes?

Hi, please help with below time conversion to minutes. one column values: 2 minutes 16 seconds 420 msec 43 seconds 750 msec 0 days 3 hours 29 minutes 58 seconds 480 msec 11 seconds 150 msec I need output in minutes(total elapsed time in minutes) (2 Replies)
Discussion started by: ramu.badugula
2 Replies

5. Shell Programming and Scripting

Move all .log except those generated in the last 5 minutes

RHEL 5.8 In the directory /u03/pkms/app_logs I have several hundreds of log files as shown below. $ pwd /u03/pkms/app_logs $ ls -alrt *.log | tail -50 -rw-r----- 1 oracle dba 9439232 May 4 13:57 mvtpcem_1_722892404_94157.log -rw-r----- 1 oracle dba 9227264 May 4 13:57... (8 Replies)
Discussion started by: kraljic
8 Replies

6. Shell Programming and Scripting

Stop append to file after 5 minutes

Hi all, I've got a grep command, in which the value (a number) is being appended into a file. Such file will have this output: 100 105 300 204 150 ... ... 120 113 124 This file will continue to append, since the grep line runs every 10 seconds. Is there a way to stop the file... (5 Replies)
Discussion started by: Wizard_1979
5 Replies

7. Shell Programming and Scripting

Find the age of a file in Minutes

KSH: Please lt me know how to find the age of a file in minutes(Based on last modified time). ie, if the file was modified 15 Minutes ago, the output should be 15 (1 Reply)
Discussion started by: hari_anj
1 Replies

8. UNIX for Dummies Questions & Answers

Script to move certain number of files every 10 minutes.

Hi, I need to move a certain number of files every 10 minutes from one folder to another. I have written the script below, however its not working, please advise. #! /bin/ksh start() { mv /test1/$(head -1000 /movetst) /test2/ sleep 600 } stop() { exit } ls ti* >... (1 Reply)
Discussion started by: amitsayshii
1 Replies

9. HP-UX

Issue with setup.hp file for webserver

Hi All, I have an issue in writing the shell script to install a webserver on UNIX system. My shell script look something like this. ------------------------------------------------------------ echo "start of the script" #! /bin/sh cd /home/path echo | setup.hp -is:javaconsole -console... (1 Reply)
Discussion started by: vishalm
1 Replies

10. Shell Programming and Scripting

Convert minutes to hours, minutes, seconds

How would you convert lets say a 1000 minutes to hours, minutes, seconds (1 Reply)
Discussion started by: Vozx
1 Replies
Login or Register to Ask a Question