Automatic Reboot

Joined
Oct 4, 2007
Messages
275
Points
0
Is there a way to do an automatic reboot. I am having memory issues and a reboot fixes it temporally. so I was wondering if there is a way to set the server to reboot every night.
 
Joined
Sep 26, 2007
Messages
38
Points
0
As root edit your crontab file and add a line with the
shutdown -r now command indicating the time you want the reboot.

Regards!
 
Joined
Oct 4, 2007
Messages
275
Points
0
so would that command look like

shutdown -r 0200

(0200) meaning 2am
 
Joined
Oct 25, 2007
Messages
60
Points
0
I had the same problem with memory resources. I have an ADM 64 Opteron with 1GB RAM. After 1 week the memory is 95% and if it reaches 99% then i can not make or receive calls. The solution i have found is:

Make a cron job with this commands

echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

The cron run this commands once a week and now my system does not need a reboot. Approximately i now have 48 days uptime.

Hope this helps.
 
Joined
Jun 14, 2007
Messages
276
Points
0
Could you clarrify this? You have to drop cache 3 times , once a week?

If you have build a manual cron script, could you share it?

If you set up the cron schedule, did you do it through Webmin?
 
Joined
Oct 25, 2007
Messages
60
Points
0
cowboy47 said:
Could you clarrify this? You have to drop cache 3 times , once a week?

If you have build a manual cron script, could you share it?

If you set up the cron schedule, did you do it through Webmin?
Sorry about that, my mistake. So let's clarrify this.

To free pagecache:

echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

echo 3 > /proc/sys/vm/drop_caches

You don't have to run all of them, just the option that you want to clean. I use the echo 3.
I did it through webmin but you can add it manually in /var/spool/cron/root.
if you want to do it manually just add to the above file one of the below:

@weekly echo 1 > /proc/sys/vm/drop_caches #memory clean pagecache
@weekly echo 2 > /proc/sys/vm/drop_caches #memory clean dentries and inodes
@weekly echo 3 > /proc/sys/vm/drop_caches #memory clean pagecache, dentries and inodes

Let me know if this work for you.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,987
Messages
131,100
Members
17,716
Latest member
Orbit114
Top