Re: shutdown as cron job?



On Sun, 20 May 2007, in the Usenet newsgroup comp.os.linux, in article
<UC34i.2443$aj.1054@trndny06>, Peter wrote:

On a single-user system, would adding shutdown as a cronjob be horribly
wrong? Or is there another/better way to specify a turn off time?

"Single-user system" - do you mean a single human at the keyboard (or
remotely accessing the system) or what?

[compton ~]$ ps aux | grep -v USER | cut -d' ' -f1 | sort -u | column
bin daemon ibuprofi lp root
[compton ~]$

Here, I'm the only human logged in - the other users are daemons, and
this list is incomplete, because users 'mail', 'news' and 'nobody' may
also pop up on occasion. That _MAY_ be a reason to not arbitrarily
shutting down the system, unless you know other daemons won't be
active when you decide to pull power.

Why do you feel it necessary to have a cron job to shut the system
down? Are you worried about energy consumption? At "last kilowatt
hour" rate, this system costs less than US$1.40 a day, running all
the time.

If you want to shut it off when not in use, see that you are running
a suitable cron daemon (anacron or fcron) rather than the normal
Vixie-cron or Dillon cron (which expect to run 24/7), and simply
run the 'shutdown -h now' command when finished your tasks.

Power cycling the system may have a 'metal fatigue' problem as the
system warms up and cools down, but this may be balanced by not
having the system powered up continuously. Your trade-off.

Old guy
.