Lurker News

Comments (568) 125 threads

Show all comments

Showing thread 3 of 125

rsync5 replies#
I built one of these for myself in 1995 and have been happily using it ever since. Here's the source code:

  0 0 19 7 *      /usr/bin/mail -s "REMINDER: john T. birthday" me@mydomain.com
  0 0 1 8 *       /usr/bin/mail -s "REMINDER: MAKE xmas hotel reservations NOW for good pricing..." me@mydomain.com
anonu3 replies#
You make your xmas hotel reservations on January 8? :) That's thinking ahead...
Raphmedia#
You are sure to get good pricing at that point!
softawre#
First day of 8th month..
xyclos#
first day of August not January 8
rak00n6 replies#
Could you explain how it works? I wonder what 0 0 19 7 * means.
CRConrad#
Regardless of what year, actually. So you're reminded of your friend's birthday every year, not just this one.

[Edit:] What the... Nope, sorry, seems you're right and I'm wrong -- weekly it is. [/Edit]

austincheney#
It is crontab.
oever#
it's a crontab file.

'0 0 19 7 ' means 'midnight of July 19th, regardless () the weekday.
It is example 2 from 'man crontab'.

nolok1 reply#
It's a unix/linux crontab, for repetitive task. See https://en.wikipedia.org/wiki/Cron

It's minute, hour, day of month, month, day of week
In this case, repeat every 19th of july at midnight.

karmelapple4 replies#
This is why I like HN, and why it continues to be a much-higher-quality place to visit on the web than many other forums: there were no snarky replies, no "I can't believe you don't know cron" - just multiple friendly, helpful replies explaining exactly what this format is.

What a good community.

Continue this thread — 4 replies

tobych#
The file is a "cron schedule" [1]. Paste the series of numbers (and the *) into the box on the site below and you'll see it means "midnight on July 19th every year". The commenter will probably have this in their personal "crontab" file. They're emailing themselves every year on that date.

[1] https://crontab.guru/

dvfjsdhgfv#
I also use Cron for the same purposes; for one-time events, especially further in the future, I use a combination of at and mail.
gyrgtyn#
Are you going to convert them all to systemd services? =p
cat199#
Switched over to 'remind' personally..

Date calculations are much more flexible and the files can be modular.. and there's printed calendar generation options if you so choose.
https://www.roaringpenguin.com/products/remind
There is also the traditional Unix 'calendar' program as well..