[SOLVED] Automatically do commands on a schedule? (linux)

Discussion in 'Bukkit Help' started by killgoblen, Apr 9, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    killgoblen

    I have a bukkit server running on linux. (On Amazon ec2, actually) I run the server using Screen. I want to know if I can write a shell script that can open the screen that the server is running in (called 'mc') and execute some commands. I would then schedule it using crontab.

    I tried this simple script:
    screen -x mc
    say test

    When I ran it, it opened the screen, but did nothing else until I stopped the server, at which point it tried running the command 'say test' (Which doesn't exist in linux.)

    So is a shell script the right way to go, or is there a better way? Thanks for any help!
     
  2. Offline

    Plague

    Code:
    screen -x mc -X stuff "`printf "say World Save in 1 minute!\r"`"
     
  3. Offline

    killgoblen

    oh thanks!
     
Thread Status:
Not open for further replies.

Share This Page