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
  #8  
Old 07-18-2008
Ikon's Avatar
Registered User
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 414
Quote:
Originally Posted by osulinux View Post
Why isn't it a good option?
If the computer is rebooted, it will need to be restarted.

If the script crashes your need to restart it.

If the script hangs you will have to restart it.


If its in cron it will automatically run when needed even if anyov the above happends.
Reply With Quote
Forum Sponsor
  #9  
Old 07-21-2008
Registered User
 

Join Date: Nov 2007
Posts: 23
Create a file ".netrc" in the home dir of the user who will be FTPing the files to the webserver. The contents of .netrc file would be the following line:
======================================================
machine webserver_ip_address login username password userpassword
======================================================
The perms set to .netrc will be 400.
Now create the script in that users' home dir as:

#!/bin/bash
FILENAME="filename.txt"
ftp -n <<FEOF
verbose
prompt
bin
put $FILENAME
FEOF

Put it inside cron.

Now well u can definately make it run every 5 mins without putting it in a cron if u make it run as a daemon and also make it available in startup/shutdown scripts. In Linux make the sym link of this script in /etc/rc.d/local dir. That should be all.
Reply With Quote
  #10  
Old 07-21-2008
Registered User
 

Join Date: Nov 2007
Posts: 23
One correction here.
Replace ftp -n with ftp web_server_ipaddress
Reply With Quote
  #11  
Old 07-31-2008
Registered User
 

Join Date: Dec 2007
Location: Diest, BE
Posts: 6
Wouldn't it be better to use RSYNC? It is more secure then ftp. Install it and read the man page to know if it is possible to do a resynchronising of your local directory with that of your server in question every 5 min. Else write a script.
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