Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
VagueRant
May 24, 2012
About to start a junior webdev job (having worked for a tech company that provided me with a 2 year old Macbook Pro I'll have to return) that seems to expect me to use my personal Windows PC for remote work, and was thinking about buying myself a Macbook just to have an easier, platform for dev work, a camera, a mic, and portability,

Wondering if an Air is worth looking into to save money on a Pro, it seems like it wouldn't chug too much for webdev work, but I hear a lot of complaints about Docker and a lot more companies using it these days.

Just looking for general advice on finding a good deal and reasonable expectations.

Adbot
ADBOT LOVES YOU

VagueRant
May 24, 2012
Trying to write a Cron schedule expression that triggers on the last Sunday of March (at 00:50).

If I do:
50 00 25-31 3 SUN
it apparently treats the date range as an OR and therefore covers EVERY Sunday in March.

The pre-existing system this plugs into will only take a raw cron expression, I can't do anything fancy and dynamic that you could do in a terminal. Am I right in saying this is impossible?

VagueRant
May 24, 2012

ShoulderDaemon posted:

This is the stupidest aspect of cron.

Per the manpage:
code:
Note: The day of a command's execution can be specified by two fields
— day of month, and day of week. If both fields are restricted (i.e.,
aren't *), the command will be run when either field matches the current
time. For example, “30 4 1,15 * 5” would cause a command to be run at
4:30 am on the 1st and 15th of each month, plus every Friday. One can,
however, achieve the desired result by adding a test to the command
(see the last example in EXAMPLE CRON FILE below).

EXAMPLE CRON FILE

#Execute early the next morning following the first
#Thursday of each month
57 2 * * 5 case $(date +d) in 0[2-8]) echo "After 1st Thursday"; esac
I have no idea why it works that way instead of being a logical and like every other field in a crontab. Everyone gets caught by this, it's never what people expect or want.

Bruegels Fuckbooks posted:

yeah. usually you'd have access to the thing the cron job is running and have it do the check inside the script or whatever to see if it's really the last sunday.
Thanks peeps. Kinda sucks, but at least I can confidently say no!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply