Re: Auto Shutdown for child user accounts
Personal preference, but I prefer not to put systemwide tasks in anyone's crontab, not even root's - I prefer to edit /etc/crontab instead.
There are at least two ways to do this. You can do it in /etc/crontab or you can do it in /etc/rc.local - whichever you prefer. Either will have to be edited as root.
Let's say you wanted to power down the machine at 10pm every night. To do it in /etc/crontab you'd do it like this -
If you wanted to shut the machine down at different times (say the kids have a later curfew on the weekend) /etc/crontab would be the way to do it.
* 22 * * * root shutdown -P now
In /etc/rc.local (which would be my preferred method since it's easy to cancel) you'd do it like this -
If you wanted to you could cancel a scheduled shutdown called from rc.local with
but this wouldn't work with an immediate shutdown scheduled as a cron job.
You could also do the scheduled shutdown with "at" but that wouldn't be much fun at all and would be a little more difficult to cancel.
Hope this helps -
Last edited by wizard10000; March 1st, 2011 at 12:25 PM.
we don't see things as they are, we see them as we are.
-- anais nin