I need a cron job that reboots the server every 1 hour between 6:AM till 3PM and reboots every 3 hours the rest of the time PM Me -- I will have you VNC to my computer to set it up on SSH for me
Lol yea the RAM is maxing out and crashes occasionally which gets me pretty mad cuz then my adsense is like at a halt
I had the same problem, but I didnt use a cron job. I had it on a VPS, but didnt remember how I did it. There are file where you can change to make this happen. Sorry I cant help you more. It was pretty easy though.
Have you try to tweak Apache and find out the root cause of the problem? Rebooting is not a long term solution
There must be a way of limiting requests. To many requests are the problem right? or is it that some of the proxy users are just leechers from megaupload and so on? In that case you can block that site.
It's not the bandwidth...so i dont think preventing leachers will help much its those session encryptions n stuff IMO does anyone know get this fixed? Cuz Im tired of rebooting 5 times a day
I have a load balancing shell programm for linux server, manually made by me. It works great for cpanel proxy servers. But the fact is, it doesn't have any automated installaton. If you are interested to take it, then i need to configure it in your server. Please PM me regarding this.
That sounds crazy! Anyway it's quite easy, just create a job that says: #! /bin/sh reboot Code (markup): Save it to some file, put chmod +x to the file and add it to your crontab to match every hour you wish (it's worth the time to learn crontab syntax, it's basically a matcher for certain times when to call your script) Crontab will basically look something like: 1 6 * * * root path/reboot-script.sh 1 7 * * * root path/reboot-script.sh 1 8 * * * root path/reboot-script.sh ... Code (markup): Hope this helps, I don't even need the $5
I usually use shutdown -r now or shutdown -f -r now (f = force) The crontab should look something like this though: 0 */1 * * * path/reboot-script.sh to reboot every hour at xx:00 I don't see the owner in my crontab If I were you I would switch webservers (either to lighttpd or something even smaller) and I would monitor those processes. Especially for proxies those should work way better, since you can push a lot more connections on those without eating up your ram. You could easily restart apache 0 */1 * * * /etc/apache2 force-restart Or you could monitor memory usage with a little script. Overall you should manage your server right. There is no need to force a restart. Apache doesn't have any memory leaks (at least not to my knowlegde) so I figure that your processes either stay as zombies or that your simply allow too many apache processes (check /etc/apache2/httpd.conf and /etc/apache2/apache2.conf) and google around to find out how to configure it right
That's true if you want to reboot every hour but see the original question That was not what he was asking for.. And I totally agree with you that this shouldn't be done anyway. Rebooting the server is not the answer to whatever problem actually is (unless of course you are using a windows box eh)
0 */3 * * * path/reboot-script.sh 0 7 * * * path/reboot-script.sh 0 8 * * * path/reboot-script.sh 0 10 * * * path/reboot-script.sh ... will still end up in less lines. The first line takes care of the reboot every 3 hours and the other lines fill in the gaps.