Results 21 to 30 of 36
ok, so if that script is working, time to put it in cron. follow my steps (1 - 3) from post #2 - just substitute the path to this script ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-18-2012 #21Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,744
ok, so if that script is working, time to put it in cron. follow my steps (1 - 3) from post #2 - just substitute the path to this script for /tmp/minecraft-cron.sh, or whatever i called it initially.
- 05-18-2012 #22Just Joined!
- Join Date
- May 2012
- Posts
- 78
so this?
1. cd into the system cron directory:
Code:
/etc/cron.d
2. create a new file with an editor, call it "minecraft"
3. in it, put the following:
Code:
# run minecraft cronjob every 5 min, send script output to log
*/5 * * * * root /root/cron_minecraft.sh > /tmp/minecraft-cronjob.log 2>&1
to ts is like this:
1. cd into the system cron directory:
/etc/cron.d
2. create a new file with an editor, call it "ts3"
3. in it, put the following:
Code:
# run ts3 cronjob every 5 min, send script output to log
*/5 * * * * root /root/cron_ts3.sh > /home/joaogl/ts3/ts3/ts-cronjob.log 2>&1
this?
- 05-19-2012 #23Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,744
if the script you've made is here:
then that is what you want to run. also, i assume you want to run it as your regular user, not root - is that true? anyway, just put whatever user you want it to run as where i've put "joaogl".Code:/home/joaogl/Documents/ts3/ts3/ts-cron.sh
here is what i think you want:
here's a break-down of the above line:Code:*/5 * * * * joaogl /home/joaogl/ts3/ts3/ts-cron.sh > /tmp/ts-cronjob.log 2>&1
Code:*/5 * * * * <-cron will call this script every five minutes joaogl <- run this script as user joaogl /home/joaogl/ts3/ts3/ts-cron.sh <- the script that will be run > <- redirect the output of the script /tmp/ts-cronjob.log <- name of file where output is saved 2>&1 <- redirect STDOUT and STDERR
- 05-19-2012 #24Just Joined!
- Join Date
- May 2012
- Posts
- 78
so like this?
cd /home/joaogl/Documents/ts3/ts3
nano ts3.sh
Code:*/5 * * * * joaogl /home/joaogl/ts3/ts3/ts-cron.sh > /tmp/ts-cronjob.log 2>&1
save it and now?
- 05-19-2012 #25Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,744
no, forget the "cd" and the "nano" part - they are confusing you.
just use crontab. be sure to run it as your regular user. run it with the "-e" parameter (e for edit). then enter the code:
then save it. you probably need to enter the sequence :wq to "write" and "quit" the crontab editor (usually it is "vi").Code:*/5 * * * * /home/joaogl/ts3/ts3/ts-cron.sh > /tmp/ts-cronjob.log 2>&1
Edit: notice you are leaving out the username in the crontab code this time!
Edit2: you can list your cron jobs with the "-l" parameter, e.g.:
again, run it as the user who created the cronjob.Code:crontab -l
after you've confirmed that it is there, look at the log in /tmp/ts-cronjob.log after 5 min have passed...Last edited by atreyu; 05-19-2012 at 08:13 PM. Reason: list cronjobs
- 05-25-2012 #26Just Joined!
- Join Date
- May 2012
- Posts
- 78
Can you give me the commands to understand?
- 05-26-2012 #27Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,744
Are you talking about understanding cron? In a terminal, make sure you are a regular user (not root), and run this command:
This will edit the current crontab for the user that ran the command. It will open the crontab in an editor (probably vi). Press the i key to enter insert mode. You can tell because at the bottom of the terminal window, you should see -- INSERT --. Then you would type the crontab line as I instructed in post #25 above. Then you would press the <Esc> key to get out of insert mode, the press :wq to write and quit the editor.Code:crontab -e
Once you are back in to your shell prompt, you can list the crontab like this:
is that what you meant?Code:crontab -l
- 05-26-2012 #28Just Joined!
- Join Date
- May 2012
- Posts
- 78
Ive done exactly like you but it says no crontab for joaogl
- 05-26-2012 #29Just Joined!
- Join Date
- May 2012
- Posts
- 78
now its working
.
But how can i open the server with the anti-crash?
- 05-26-2012 #30Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,744


Reply With Quote

