Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> My first cron script, Help me
{XN}Boylett
post Aug 28 2006, 05:28 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 18
Joined: 27-August 06
Member No.: 7,075



In the crontab:

CODE
# Restart server
0,2 * * * * /server/sv_up.sh >/dev/null 2>&1



In sv_up.sh:

CODE
#!/bin/sh

mtaserverdir="/server/"
process=`ps auxw | grep linuxq3ded | grep -v grep | awk '{print $11}'`

if [ -z "$process" ]; then

  echo "Couldn't find MTA Server running, restarting it."
  cd "$mtaserverdir"
  nohup ./mtaserver +exec ffa.cfg &
  echo ""

fi


What im trying to do is make sv_up.sh run every 2 minutes.
And what I want sv_up.sh to do is start mtaserver.exe if it isnt running
Can anyone help me? It doesnt work dry.gif
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
michaelk
post Aug 30 2006, 04:34 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



All I can say is interesting. I'm not sure what is going on here at the moment. You can turn of cron but that will stop all other jobs too.
Go to the top of the page
 
+Quote Post

Posts in this topic
- {XN}Boylett   My first cron script   Aug 28 2006, 05:28 AM
- - michaelk   Does the script run successfully from the console?...   Aug 28 2006, 06:21 AM
|- - {XN}Boylett   QUOTE (michaelk @ Aug 28 2006, 12:21 PM) ...   Aug 28 2006, 06:42 AM
- - {XN}Boylett   CODE# Restart server */2 * * * * /server/sv_up.sh ...   Aug 28 2006, 07:33 AM
- - michaelk   What is the error message?   Aug 28 2006, 09:44 AM
|- - {XN}Boylett   QUOTE (michaelk @ Aug 28 2006, 03:44 PM) ...   Aug 28 2006, 11:41 AM
- - michaelk   */2 * * * * /server/sv_up.sh >/dev/null 2>...   Aug 28 2006, 12:11 PM
|- - {XN}Boylett   QUOTE (michaelk @ Aug 28 2006, 06:11 PM) ...   Aug 29 2006, 07:04 AM
- - michaelk   I do not see anything obvoiusly wrong with the lin...   Aug 29 2006, 10:17 AM
- - {XN}Boylett   Would it help if i said i get the error about 2 mi...   Aug 29 2006, 03:31 PM
- - michaelk   Try changing the line to * * * * * /server/sv_up....   Aug 29 2006, 04:53 PM
|- - {XN}Boylett   QUOTE (michaelk @ Aug 29 2006, 10:53 PM) ...   Aug 30 2006, 02:15 PM
- - michaelk   All I can say is interesting. I'm not sure wh...   Aug 30 2006, 04:34 PM
- - {XN}Boylett   oh well im happy it doing that every minute. anywa...   Sep 11 2006, 01:55 PM
- - michaelk   Does the script work running from a console?   Sep 11 2006, 03:36 PM
- - {XN}Boylett   Sorry, what does that mean? I run Cron on my compu...   Sep 13 2006, 11:32 AM
- - michaelk   cron at the scheduled time executes the script sv_...   Sep 13 2006, 03:40 PM
- - {XN}Boylett   Whats a terminal window?   Sep 13 2006, 05:26 PM
- - michaelk   A console or terminal window is an application typ...   Sep 13 2006, 05:36 PM
- - {XN}Boylett   i have windows xp. how do i start it?   Sep 14 2006, 10:59 AM
- - DS2K3   You have CRON on Windows XP?   Sep 14 2006, 01:37 PM
- - {XN}Boylett   I did. Now Ive just installed windows server 2003 ...   Sep 14 2006, 02:24 PM
- - michaelk   I'm totaly lost now.....   Sep 14 2006, 03:58 PM
- - {XN}Boylett   um ok ill have a fiddle with it. ill post the ^new...   Sep 15 2006, 03:11 PM
- - DS2K3   Sorry - Should you not be on a Windows help site?   Sep 15 2006, 05:00 PM
- - {XN}Boylett   with a cron and a shell script?   Sep 16 2006, 03:01 AM
- - michaelk   The console or terminal window has nothing to do w...   Sep 17 2006, 09:32 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2017 - 03:19 PM