Automatic Reboot

Telco

Joined
Oct 4, 2007
Messages
275
Likes
0
Points
0
#1
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.
 

moyses

Joined
Sep 26, 2007
Messages
38
Likes
0
Points
0
#2
As root edit your crontab file and add a line with the
shutdown -r now command indicating the time you want the reboot.

Regards!
 

Telco

Joined
Oct 4, 2007
Messages
275
Likes
0
Points
0
#3
so would that command look like

shutdown -r 0200

(0200) meaning 2am
 

zeus

Joined
Oct 25, 2007
Messages
60
Likes
0
Points
0
#4
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.
 

cowboy47

Joined
Jun 14, 2007
Messages
276
Likes
0
Points
0
#5
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?
 

zeus

Joined
Oct 25, 2007
Messages
60
Likes
0
Points
0
#6
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.
 

cowboy47

Joined
Jun 14, 2007
Messages
276
Likes
0
Points
0
#7
Thanks, that helps a lot.

C
 

Members online

No members online now.

Forum statistics

Threads
30,952
Messages
130,980
Members
17,654
Latest member
janko67
Top