The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create a restart Script

Discussion in 'General Discussion' started by xp2u, May 11, 2003.

  1. xp2u

    xp2u Active Member

    Joined:
    Jan 27, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    How to create a restart script for Tom_Cat?

    #!/usr/bin/perl
    system("usr/sbin/stoptomcat");
    system("usr/sbin/starttomcat");
    exit;

    After that I chmod filename 755

    I put the filename in /scripts/

    Can I execute /scripts/filename to call for restart tomcat?

    Please help.......
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Why don't you use WHM? Are you wanting to create a cron job or something?
     
  3. xp2u

    xp2u Active Member

    Joined:
    Jan 27, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Ya

    Ya I want to create a cron job and also other purpose like adding to my reseller WHM so that particular reseller can restart Tom-Cat too.

    If you guy knows how, please help..
     
  4. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    There's already a script for restarting tomcat. You could probably create a cron job for it as follows:


    lynx -cookies -dump -auth=root:your_root_password_here http://your_main_server_ip_here:2086/scripts/restomcat


    all the above on one line in your Control panel cron manager.

    Minute Hour Day Month Weekday

    0 0 * * *

    That would restart it every night at midnight. Modify as needed.
     
    #4 casey, May 11, 2003
    Last edited: May 11, 2003
  5. xp2u

    xp2u Active Member

    Joined:
    Jan 27, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    /scripts/restomcat

    /scripts/restomcat is actually not working. I have tried this. there is no such script restomcat in /scripts/ direcotry.

    I need to set to my reseller WHM or cpanel too. So, I need a script to work around since /scripts/restomcat is not functioning
     
  6. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Try this

    0 0 * * * /usr/sbin/stoptomcat;/usr/sbin/starttomcat

    That should work, which is basically what the whm and the restart sript do.
     
Loading...

Share This Page