This is a discussion on Cron to check a website and restart it if down within the Shell scripting forums, part of the Development/Scripting category; hi, #!/bin/sh wget website.com -o /tmp/web value=`cat /tmp/web |grep OK | nl|awk '{print$1}'` if [ $value -eq '' ] then ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
hi,
Quote:
but I know there are better ways to do that whats your way? Thanks |
| Sponsored Links | ||
|
|
|
|||
|
I like yours more than mine, .. still i'll paste it here for global interest.
Quote:
|
|
||||
|
nice work, here my script from bsd box
Code:
#!/bin/sh isAlive=`ps ax | grep -v grep | grep -c httpd` if [ $isAlive -le 0 ] then /usr/local/etc/rc.d/apache restart fi
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
| Tags |
| apache script , shell script |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tomcat shell script cron job to restart server | kasimani | Shell scripting | 4 | 05-03-2008 07:46 PM |
| How to host website using adsl router | zeebala | CentOS / RHEL / Fedora | 2 | 04-01-2008 09:23 PM |
| How to host website using adsl router | zeebala | CentOS / RHEL / Fedora | 0 | 11-29-2007 07:15 PM |
| Cron job on Fedora 7 | angenet | Linux software | 1 | 10-04-2007 05:11 PM |
| Cron problem | vin6384 | Linux software | 1 | 03-08-2006 09:48 PM |