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?
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?Code:#!/bin/bash while : ; do killall java java -Xmx192M server sleep 3600 killall java java -Xmx192M server done
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.)
Meh - It doesn't seem to work in a one minute test, and my brother is sleeping -.-
Issue resolved - I'm such an idiot.
*Sigh* I just got here too. XD
Wow I changed my sig!
Yep, I got crontabs to work with daemon... Rofl, it wasn't even hard, but I'm a moron with the shell command.
Kindly.. POST in the solution...
moreover... Please xplain about using CRON jobs.
Regards.
© Copy Rights. DE-Shell
# root crontab
# SYSTEM DAILY/WEEKLY/... FOLDERS
@hourly ID=sys-hourly /usr/sbin/run-cron /etc/cron.hourly
@daily ID=sys-daily /usr/sbin/run-cron /etc/cron.daily
@weekly ID=sys-weekly /usr/sbin/run-cron /etc/cron.weekly
@monthly ID=sys-monthly /usr/sbin/run-cron /etc/cron.monthly
* * * 1,2,3,4,5 2-5 root [pathOfTheScript] - randomly
If you need any further assistance, let me know.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks