Anyone here good with cron?

Entity

Lifer
Oct 11, 1999
10,090
0
0
I just found out I had an errant crontab which was sending tons of emails to root, and consequently pissing off our postmaster a bit. :)

I changed the syntax...but I'm not sure how to make sure it's working properly, besides waiting for the postmaster to yell again - if he doesn't, then it's ok. ;)

Should this work?

0 * * * * /usr/lib/cgi-bin/stats/pctstats >> /dev/null 2>&1

the old cron job looked like this...

0 * * * * /usr/lib/cgi-bin/stats/pctstats

...and was emailing all sorts of garbage to root@hostname.

Am I ok now?

Rob
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: Entity
I just found out I had an errant crontab which was sending tons of emails to root, and consequently pissing off our postmaster a bit. :)

I changed the syntax...but I'm not sure how to make sure it's working properly, besides waiting for the postmaster to yell again - if he doesn't, then it's ok. ;)

Should this work?

0 * * * * /usr/lib/cgi-bin/stats/pctstats >> /dev/null 2>&1

the old cron job looked like this...

0 * * * * /usr/lib/cgi-bin/stats/pctstats

...and was emailing all sorts of garbage to root@hostname.

Am I ok now?

Rob

The >> only needs to be a >, but yeah, it looks fine - stdout is going to /dev/null, and stderr is going to stdout (thus /dev/null).
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Originally posted by: BingBongWongFooey
Originally posted by: Entity
I just found out I had an errant crontab which was sending tons of emails to root, and consequently pissing off our postmaster a bit. :)

I changed the syntax...but I'm not sure how to make sure it's working properly, besides waiting for the postmaster to yell again - if he doesn't, then it's ok. ;)

Should this work?

0 * * * * /usr/lib/cgi-bin/stats/pctstats >> /dev/null 2>&1

the old cron job looked like this...

0 * * * * /usr/lib/cgi-bin/stats/pctstats

...and was emailing all sorts of garbage to root@hostname.

Am I ok now?

Rob

The >> only needs to be a >, but yeah, it looks fine - stdout is going to /dev/null, and stderr is going to stdout (thus /dev/null).
Will it work as >> or >?

Rob
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: Entity
Originally posted by: BingBongWongFooey
Originally posted by: Entity
I just found out I had an errant crontab which was sending tons of emails to root, and consequently pissing off our postmaster a bit. :)

I changed the syntax...but I'm not sure how to make sure it's working properly, besides waiting for the postmaster to yell again - if he doesn't, then it's ok. ;)

Should this work?

0 * * * * /usr/lib/cgi-bin/stats/pctstats >> /dev/null 2>&1

the old cron job looked like this...

0 * * * * /usr/lib/cgi-bin/stats/pctstats

...and was emailing all sorts of garbage to root@hostname.

Am I ok now?

Rob

The >> only needs to be a >, but yeah, it looks fine - stdout is going to /dev/null, and stderr is going to stdout (thus /dev/null).
Will it work as >> or >?

Rob

It should work fine with either, ">/dev/null" is just sort of the common thing to do. > writes to a file (creates it if not there, erases prior contents) while >> appends (also creates if not there).