Extra chars in email from cron job


#1

Hi

I have a cron job running nightly:
ssh localhost ‘/usr/local/bin/certbot-auto renew --max-log-backups 25 --non-interactive --no-bootstrap --no-self-upgrade --post-hook “apachectl graceful”’

This works, no problem but the format of the mail has changed from

----------------------------------------
Processing /etc/letsencrypt/renewal/www.XYZ.com.conf
----------------------------------------
Cert not yet due for renewal

to having more spaces like so:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/www.XYZ.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal

Is makes it a little less readable, too many spaces less looking like a line (I use mutt).
Was this intended?

Would it not be better to have
-----------------------------------------------------------------------
instead of
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
which turns out to be the same amount of chars but the first one is more readable, looks more like a line, less spaces but same amount of chars.

thanks


#2

It was intentional. It was done because, when pasted on this forum outside of a code block, ---------------------------------------- results in this:


Processing /etc/letsencrypt/renewal/www.XYZ.com.conf

Cert not yet due for renewal

It’s a tradeoff between console readability and support forum readability. :sweat:


#3

Ok, get it and understand.

Could underscores as in
___________________________________________
be used instead of
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
as the last one looks crap in Mutt.

Just asking and/or making a suggestion!


#4

@jsha @bmw, what do you think of this suggestion?


#5

Thanks for the suggestion! At the time I filed the linked issue, I tried some other variations, like underscores ("________") and found that they all triggered the Markdown “heading” behavior. So changing to underscores wouldn’t achieve the goal of avoiding accidental markdown headings.

Also, I’d definitely recommend adding -q to your cronjob so it doesn’t send you email unless there’s something important like an error. Otherwise, I’m guessing you’ll start ignoring the cron emails after a while because you get them nightly and there’s usually nothing to report.


#6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.