# Timed automatic reboot



## leyshon (Dec 5, 2008)

Hi

Does anyone have a script / command that I can install that will make a computer running freebsd reboot at a preset time of day (say 3:00 am) every day?


----------



## DutchDaemon (Dec 5, 2008)

How about a simple cron job?


```
0 3 * * * /sbin/shutdown -r now
```

Mind you, 3 AM is a bad time, because a lot of administrative bookkeeping is going on at that time. Better make it 2 AM or 4 AM.


----------



## anomie (Dec 5, 2008)

leyshon said:
			
		

> ... make a computer running freebsd reboot at a preset time of day (say 3:00 am) every day?



Also: why do you want to do this?


----------



## davehouston (Dec 6, 2008)

anomie said:
			
		

> Also: why do you want to do this?



I'm also interested to know why your doing this?


----------



## tingo (Dec 7, 2008)

leyshon said:
			
		

> Hi
> 
> Does anyone have a script / command that I can install that will make a computer running freebsd reboot at a preset time of day (say 3:00 am) every day?


It is better if you explain what you are trying to accomplish. Rebooting the machine is probably the wrong way to do it.
Are you trying to restart a service?


----------



## leyshon (Dec 8, 2008)

Hi

I have a runaway process that I am trying to overcome. I am preparing a new installation to replace the present one because I have insufficient experience to figure out what is wrong with the present installation (which is already several upgrades old) Meanwhile a reboot solves a lot of problems.


----------



## anomie (Dec 8, 2008)

@leyshon: Find the runaway process using *ps* (or *top*) and identify its PID. Then with that info, post the results of: 

*# fstat -p <pid_here>*

Maybe someone can help you troubleshoot the problem.


----------



## SirDice (Dec 9, 2008)

leyshon said:
			
		

> Meanwhile a reboot solves a lot of problems.


Not quite. It removes the symptoms but not the problem.


----------

