+ Reply to Thread
Results 1 to 6 of 6

Thread: Shell Script Help!

  1. #1
    Newbie SeanStar is an unknown quantity at this point SeanStar's Avatar
    Join Date
    Nov 2009
    Posts
    27

    Shell Script Help!

    Hello, I'm running a server on a dedicated Linux server from the command line.
    I need a simple restarter to restart it every hour.

    Will this work?

    Code:
    #!/bin/bash
    while : ; do
    killall java
    java -Xmx192M server
    sleep 3600
    
    killall java
    java -Xmx192M server
    done
    I tried using cron... But I have no real sense of it.. It seems easy, but can it be run in the background as daemon?

    Sorry guys, but my brother is the one all about linux, I do use linux, but not much from the command line.

    Thanks.

    (I hope I don't look like a moron like others on this forums, Rofl.)

  2. #2
    Newbie SeanStar is an unknown quantity at this point SeanStar's Avatar
    Join Date
    Nov 2009
    Posts
    27

    Re: Shell Script Help!

    Meh - It doesn't seem to work in a one minute test, and my brother is sleeping -.-

  3. #3
    Newbie SeanStar is an unknown quantity at this point SeanStar's Avatar
    Join Date
    Nov 2009
    Posts
    27

    Re: Shell Script Help!

    Issue resolved - I'm such an idiot.

  4. #4
    Moderator ZekeDragon is a name known to all ZekeDragon is a name known to all ZekeDragon is a name known to all ZekeDragon is a name known to all ZekeDragon is a name known to all ZekeDragon is a name known to all ZekeDragon's Avatar
    Join Date
    Jul 2009
    Location
    Nowhere, Washington
    Posts
    1,766
    Blog Entries
    40

    Re: Shell Script Help!

    *Sigh* I just got here too. XD
    Should I get a userbar here?

  5. #5
    Newbie SeanStar is an unknown quantity at this point SeanStar's Avatar
    Join Date
    Nov 2009
    Posts
    27

    Re: Shell Script Help!

    Yep, I got crontabs to work with daemon... Rofl, it wasn't even hard, but I'm a moron with the shell command.

  6. #6
    Newbie Hassan Seth is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    8

    Re: Shell Script Help!

    Kindly.. POST in the solution...

    moreover... Please xplain about using CRON jobs.



    Regards.

    © Copy Rights. DE-Shell

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Making a GUI in a Shell Script
    By dargueta in forum Linux Tutorials, Guides and Tips
    Replies: 13
    Last Post: 11-27-2009, 02:41 PM
  2. Shell script string operator problem
    By DarkLordoftheMonkeys in forum Linux Programming and Scripting
    Replies: 2
    Last Post: 11-12-2009, 03:32 PM
  3. Problem - Grep cammand in shell script
    By prasannasupp in forum Linux Programming and Scripting
    Replies: 2
    Last Post: 09-08-2009, 11:36 AM
  4. Shell Script Date YYYYMMDD Format
    By Tor in forum Shell Scripts
    Replies: 2
    Last Post: 08-26-2008, 09:01 PM
  5. Writing to a File - Shell Script Help!
    By dirkfirst in forum General Programming
    Replies: 2
    Last Post: 10-03-2006, 06:02 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts