![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
||||
|
||||
|
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. |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
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. |
|
#10
|
|||
|
|||
|
One correction here.
Replace ftp -n with ftp web_server_ipaddress |
|
#11
|
|||
|
|||
|
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.
|
|||
| Google The UNIX and Linux Forums |