Originally Posted by chrism01
The default cron env is minimal; you should use full absolute paths to every cmd & file referenced, or set up the correct env (eg via 'source' cmd) at the top of your shell script (after #!/bin/bash) on next line(s).
See /var/log/cron (at least on RH) for cron msgs.
Also, if cron itself has an issue, it'll email the job owner or root.
Also amend cron cmd
0 5 * * * /home/minecraft/autorestart.sh >> /home/minecraft/autolog.log 2>&1
youve lost me ?
as i say the script runs perfectly when trigered from the terminal
when cron trigers it ....well it cant find screen
do you mean in my script i change
screen -S max -X stuff "say 5 "
screen -S max -X eval "stuff \015"
/linux/programfiles/screen/screen -S max -X stuff "say 5 "
/linux/programfiles/screen/screen -S max -X eval "stuff \015"
the /linux/programfiles/screen/ is just a guess as im not able to access the server right now to locate screen, im assuming along the line of windows the path will be similier
but then why would it work from terminal but not cron thats what i dont understand isnt cron simply automating me doing the command?
i have an idea... i cant test at mo so please tell me if its crazy
i set cron to run this script
it would be even better if i could make it do it as user minecraft but i guess there has to be some limitations lol
would that work?