Please, add a year field to cron!



  • Well, a year ago, for some reason this was added to the cron in every production server:

     55 3 17 5 * /home/jboss/bin/change_release_symlink

    Guess what day it's today.

    I just spent two hours wondering why our systems were down, why the release folder was pointing to a year old version, why would someone do this and finally, why cron doesn't have a year field but instead a "Day of the week" one.


  • Discourse touched me in a no-no place

    @ubersoldat said:

    why would someone do this
    It's not beyond the bounds of probability that a year ago, that change needed to be made at a time when no-one/few were using the system and the admin couldn't be arsed to disrupt their sleep pattern by staying awake and simply scripted it instead. And they forgot to delete it afterwards.@ubersoldat said:
    and finally, why cron doesn't have a year field but instead a "Day of the week" one.
    Because this (assuming I'm right,) and whatever use a year field would achieve, is an abuse of cron. The day of week is for stuff that, e.g., needs to be done every Sunday evening at 2200hrs, like weekly backups.



  • Any idea what cron is for? For repeated tasks. It's practical to say "compress backup every saturday at 03:00", or to clean out logs every 1st of the month. If you want to do a task only once, don't use cron, use the "at" command. So the one who added this entry, didn't really think very well.



  •  @TGV said:

    Any idea what cron is for? For repeated tasks. It's practical to say "compress backup every saturday at 03:00", or to clean out logs every 1st of the month. If you want to do a task only once, don't use cron, use the "at" command. So the one who added this entry, didn't really think very well.

    Yeah, we agree on that.



  •  Please, add a Phillips head tip to hammer!



  • @ubersoldat said:

    Well, a year ago, for some reason this was added to the cron in every production server:

     55 3 17 5 * /home/jboss/bin/change_release_symlink

    Guess what day it's today.

    I just spent two hours wondering why our systems were down, why the release folder was pointing to a year old version, why would someone do this and finally, why cron doesn't have a year field but instead a "Day of the week" one.

     

    wow ... so full of fail!

    1) blaming the tool istead of the tool that use a recurring job for a one time task.

    2) blaming a tool for mising a feature it has; (it is the only optional one though).

    3) the "day of the week" field is so you can set schedules like every friday etc. cron is very general, you can set up any kind of reccurring schedule.

    Basically someone misconfigured a task and you blame the tools you are TRWTF!


     



  •  @PJH said:

    ... and whatever use a year field would achieve, is an abuse of cron.
     @flabdablet said:

     Please, add a Phillips head tip to hammer!

     

    Apparently they did there is a year field in cron. I'd think of it as adding a once option, instead of an abuse.



  • @esoterik said:

    2) blaming a tool for mising a feature it has; (it is the only optional one though).

    Not all cronds support a year field; vixie (which is probably the most widely-used on Linux) doesn't, for example.



  • @morbiuswilters said:

    @esoterik said:
    2) blaming a tool for mising a feature it has; (it is the only optional one though).

    Not all cronds support a year field; vixie (which is probably the most widely-used on Linux) doesn't, for example.

    well that is what @TGV said:
    the [linux] "at" command
    is for after all.



  • @esoterik said:

    @morbiuswilters said:

    @esoterik said:
    2) blaming a tool for mising a feature it has; (it is the only optional one though).

    Not all cronds support a year field; vixie (which is probably the most widely-used on Linux) doesn't, for example.

    well that is what @TGV said:
    the [linux] "at" command
    is for after all.

    I agree, but you can't really get pissy with the OP for being unaware of a cron feature that the most popular cron daemon lacks.



  • @esoterik said:

     @PJH said:

    ... and whatever use a year field would achieve, is an abuse of cron.
     @flabdablet said:

     Please, add a Phillips head tip to hammer!

     

    Apparently they did there is a year field in cron. I'd think of it as adding a once option, instead of an abuse.

     

    Here we go with short term thinking again. Using the year field is just planning for events post 2038.

    (too late in the day to work out the math properly, it'd be 2080 or something, but er, dang, I think time_t is signed... whatever).

     

     



  • @morbiuswilters said:

    @esoterik said:

    @morbiuswilters said:

    @esoterik said:
    2) blaming a tool for mising a feature it has; (it is the only optional one though).

    Not all cronds support a year field; vixie (which is probably the most widely-used on Linux) doesn't, for example.

    well that is what @TGV said:
    the [linux] "at" command
    is for after all.

    I agree, but you can't really get pissy with the OP for being unaware of a cron feature that the most popular cron daemon lacks.

    Sure you can.  man 5 crontab clearly shows that a year field is not supported.  There are examples of aliases (@yearly, @annually) that will get something to run once a year, but it clearly shows there's no user-definable year field.

    I haven't seen the year field under FreeBSD, Solaris, or Linux.  I don't recall seeing it mentioned in my generic "here's-how-to-do-it-under-all-UNIXes" book, but I've been up since 0430 working a bad network link and I'm too tired to check right now.



  • @nonpartisan said:

    Sure you can.  man 5 crontab clearly shows that a year field is not supported.  There are examples of aliases (@yearly, @annually) that will get something to run once a year, but it clearly shows there's no user-definable year field.

    I haven't seen the year field under FreeBSD, Solaris, or Linux.  I don't recall seeing it mentioned in my generic "here's-how-to-do-it-under-all-UNIXes" book, but I've been up since 0430 working a bad network link and I'm too tired to check right now.

    Umm.. what? I said you can't get pissed at someone who didn't know some cron daemons support a year field, because most don't.



  • Will sdate help?



  • @nonpartisan said:

    I've been up since 0430 working a bad network link and I'm too tired to check right now.
     

    Work that bad network link, $descriptive_adjective boy!

     



  • @morbiuswilters said:

    @nonpartisan said:

    Sure you can.  man 5 crontab clearly shows that a year field is not supported.  There are examples of aliases (@yearly, @annually) that will get something to run once a year, but it clearly shows there's no user-definable year field.

    I haven't seen the year field under FreeBSD, Solaris, or Linux.  I don't recall seeing it mentioned in my generic "here's-how-to-do-it-under-all-UNIXes" book, but I've been up since 0430 working a bad network link and I'm too tired to check right now.

    Umm.. what? I said you can't get pissed at someone who didn't know some cron daemons support a year field, because most don't.

    Okay, I misread your reply. 15ish hours into the day at that point and still up. Either we have a major fiber cable failure or someone is missing a patch point in the documentation. Because other circuits are running on the same fiber, my guess is the latter.


  • Discourse touched me in a no-no place

    @esoterik said:

    I'd think of it as adding a once option, instead of an abuse.
    ... but you'd be repeating yourself if you did.



  • @TGV said:

    Any idea what cron is for? For repeated tasks. It's practical to say "compress backup every saturday at 03:00", or to clean out logs every 1st of the month. If you want to do a task only once, don't use cron, use the "at" command. So the one who added this entry, didn't really think very well.
     

    Uh, if I may be Socratic here, what does the word cron actually mean?  Surely it comes from the Greek chronos, meaning time, so it's a way to get a task to run at a certain time (implied contrast: instead of right now).  There's nothing about that concept that requires it to be run again and again.



  • @da Doctah said:

    @TGV said:

    Any idea what cron is for? For repeated tasks. It's practical to say "compress backup every saturday at 03:00", or to clean out logs every 1st of the month. If you want to do a task only once, don't use cron, use the "at" command. So the one who added this entry, didn't really think very well.
     

    Uh, if I may be Socratic here, what does the word cron actually mean?  Surely it comes from the Greek chronos, meaning time, so it's a way to get a task to run at a certain time (implied contrast: instead of right now).  There's nothing about that concept that requires it to be run again and again.

    Ah, but in Greek mythology, Chronos was responsible for the creation of the universe. In fact, I say it's ridiculous that cron doesn't have a field for indicating the creation of a new universe.


    Or perhaps we shouldn't be making technical decisions based on ancient myths and vocabularies of dead languages.



  • @da Doctah said:

    @TGV said:

    Any idea what cron is for? For repeated tasks.
     

    Uh, if I may be Socratic here, what does the word cron actually mean?  Surely it comes from the Greek chronos, meaning time, so it's a way to get a task to run at a certain time (implied contrast: instead of right now).  There's nothing about that concept that requires it to be run again and again.

    In the *nix world, there's usually clear distance between the command's function and the word's meaning.



  • @Cassidy said:

    @da Doctah said:

    @TGV said:

    Any idea what cron is for? For repeated tasks.
     

    Uh, if I may be Socratic here, what does the word cron actually mean?  Surely it comes from the Greek chronos, meaning time, so it's a way to get a task to run at a certain time (implied contrast: instead of right now).  There's nothing about that concept that requires it to be run again and again.

    In the *nix world, there's usually clear distance between the command's function and the word's meaning.

    Waitaminute.. you're saying the background processes on my computer aren't violating the Second Law of Thermodynamics? Well I'll be goddamned.



  • @morbiuswilters said:

    I say it's ridiculous that cron doesn't have a field for indicating the creation of a new universe.
     

    Dude, check your man pages again. Just because it's not implemented on your crappy system ...

     



  • @Cassidy said:

    In the *nix world

    This wildcard is obsolete. It was relevant maybe 20 years ago with Unix, Minix and Xenix, but now it should be .+n.x or ((os|(li|u)n[ui])x)|.*bsd to make everyone happy.



  • Still doesn't fix the issue for me.

    (Cromix user)



  • @Speakerphone Dude said:

    @Cassidy said:
    In the *nix world

    This wildcard is obsolete. It was relevant maybe 20 years ago ...

    groan. Yup, dude. Thanks for thanks for correcting me, else others on this forum would have been confused to the ambiguity of my statement and not actually understood what I meant.

    Now, moving on... you know when people have talked about being a pedantic dickweed? Well -- no, on second thoughts, never mind.

    Keep calm and carry on.




Log in to reply