Results 1 to 1 of 1

Thread: Crontab Permission Denied

  1. #1
    Join Date
    May 2011
    Beans
    1

    [SOLVED] Crontab Permission Denied

    I'm having problem with crontab when I'm running a script.
    My sudo crontab -e looks like this:
    Code:
     05 00 * * * /opt/mcserver/backup.sh
     10 00 * * * /opt/mcserver/suspend.sh
     05 08 * * * /sbin/shutdown -r +1
     11 11 * * * /opt/mcserver/start.sh  <--- This isn't working
    And the start.sh looks like this:

    Code:
      
    #!/bin/sh
    screen java -d64 -Xincgc -Xmx2048M -jar craftbukkit.jar nogui
    and have these permissions (ls -l output)
    Code:
      -rwxr-xr-x 1 eve eve  72 Nov 24 14:17 start.sh
    I can run the command from the terminal, either using sudo or not

    Code:
    ./start.sh
    But it wont start with crontab. If i do

    Code:
      grep -iR "start.sh" /var/log
    I get the following output
    Code:
      
    /var/log/syslog:Nov 27 11:11:01 eve-desk CRON[5204]: (root) CMD (eve /opt/mcserver/start.sh)
     grep: /var/log/btmp: Permission denied
     grep: /var/log/lightdm/x-0-greeter.log: Permission denied
     grep: /var/log/lightdm/lightdm.log: Permission denied
     grep: /var/log/lightdm/x-0.log: Permission denied
    So my question is, why isn't it working? And since my script run without using sudo, I don't necessarily need to put it in sudo crontab, am I right?
    ( and I'm using Ubuntu 12.10 )

    Thanks in advance,
    KentAgent

    Solved!

    Screen in my start script needed proper flags, so this worked:
    Code:
    screen -d -m java -d64 -Xincgc -Xmx2048M -jar craftbukkit.jar nogui
    Last edited by KentAgent; November 28th, 2012 at 11:08 PM. Reason: solved!

Tags for this Thread

Bookmarks

Posting Permissions

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