shutdown as cron job? - Linux

This is a discussion on shutdown as cron job? - Linux ; 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? TIA -- Peter...

+ Reply to Thread
Results 1 to 4 of 4

Thread: shutdown as cron job?

  1. shutdown as cron job?

    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?

    TIA

    --
    Peter

  2. Re: shutdown as cron job?

    On Sun, 20 May 2007, in the Usenet newsgroup comp.os.linux, in article
    , 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

  3. Re: shutdown as cron job?

    On Mon, 21 May 2007 19:31:12 -0500, Moe Trin wrote:

    > On Sun, 20 May 2007, in the Usenet newsgroup comp.os.linux, in article
    > , 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?
    >

    Thanks. I should have clarified. The system is used by one person, BUT is
    part of a small network with shared folders and devices.

    snip...
    >
    > 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.
    >


    Other than the fact that I turn lights off when I leave a room, turn a
    car off when I come home, I think that when done working, turn the
    computer off too. You're absolutely correct, but I am old school.

    The main reason I want to do this is that the other users (i.e. kids) are
    up much later than me.

    > 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.
    >


    Currently, when I think of it, I use something akin to
    shutdown -h XX:YY &
    at a prompt.

    > 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.
    >

    LOL.

    > Old guy




    --
    Peter

  4. Re: shutdown as cron job?

    On Tue, 22 May 2007, in the Usenet newsgroup comp.os.linux, in article
    , Peter wrote:

    >Moe Trin wrote:


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

    >
    >Thanks. I should have clarified. The system is used by one person, BUT is
    >part of a small network with shared folders and devices.


    OK - just be certain that any remote access is shut down before your cron
    job yanks the plug. You don't need a corrupted file because the system
    when down _while_ some other process was altering a file. Using a
    journaled filesystem like EXT3 (a.k.a. e3fs) can minimize the problem.

    >Other than the fact that I turn lights off when I leave a room, turn a
    >car off when I come home, I think that when done working, turn the
    >computer off too. You're absolutely correct, but I am old school.
    >
    >The main reason I want to do this is that the other users (i.e. kids)
    >are up much later than me.


    My file servers run 24/7, but lacking a display (keyboard, mouse and
    all), they're relatively low power. Kids? I dunno, maybe they start
    it when they get home, and it shuts down an hour after bedtime.

    >> 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.

    >
    >Currently, when I think of it, I use something akin to
    >shutdown -h XX:YY &
    >at a prompt.


    That will also work. The reason I was suggesting the other cron
    daemon (anacron or fcron) is that they will attempt to run tasks that
    would be missed if the compute is not running when the "normal" cron
    tasks are scheduled. My systems do a lot of housekeeping tasks such
    as log rotation, database updates, on-site and off-site backups (my
    sister on the other side of the country backs up changes to her systems
    to one of my servers - I do the same) in the wee-hours of the night
    when user activity is low. A task like 'updatedb' (creating the
    'locate' database) or makewhatis (which creates the database used by
    the 'whatis' and 'apropos' commands) can put a noticeable burden on the
    CPU even if re-niced to +15.

    >> 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.

    >
    >LOL.


    Actually, there is more than a germ of truth in that statement.

    Old guy

+ Reply to Thread