0

In an answer to the question How to shutdown Linux at a specific datetime from terminal? a high-rep user provides two solutions: using at and using cron. The cron-based option says "this not a good idea for shutdown".

Why would this not be a good idea? I know that at removes tasks from its queue after executing them, while jobs entered in cron just remain visible. Are there any other arguments besides the above that would support using at over cron for a shutdown?

  • 1
    It's all explained in the comments to that answer.... – xenoid Jan 7 at 13:03
  • Actually xe provides three solutions, the primary one being right at the start of the answer. – JdeBP Jan 7 at 14:11
  • @xenoid Comments cannot be relied upon to be permanent. – Christophe Strobbe Jan 21 at 10:09
  • Nor are answers... – xenoid Jan 21 at 11:00
  • @xenoid That's not the same thing. Comments are explicitly intended to prompt clarifying edits. Comments don't replace answers. – Christophe Strobbe Jan 21 at 11:07
4

cron is used to specify repeated tasks. Executed tasks remain visible and active.

If you schedule via cron a shutdown for the 14 of the month and forget to remove the cron job afterwards, the server will shut down again one month later. When working with systems it's a good habit to make things as foolproof as possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.