Thanks, @vgaetera . I’ll take a look at that… later. I’ve got a big crontab I want to install and have running. Some day I’ll switch over to the new way.
Found the problem. For some reason date +“%R” isn’t executing properly within cron. It works fine at the commandline. I changed that to simply “date” and then I got the output. Has to be that cron is mangling the +“%R” for some reason.
I tested your theory and it certainly seems the formatting does not get processed when date is called by cron.
What I also tested was writing a simple script to process the date command you wished, then used cron to call that script. In that way it seems to work as you expected and the output is formatted.
The content of the script is simply
Thanks, @computersavvy that’s always a good alternative.
I played around with the crontab entry and found that cron was horking on the ambersand (&) and so if I backslash-escaped it, it worked as it should. I.e.,
/usr/bin/date “+%R” >> … (there’s supposed to a backslash character right before the percent-sign, but the web software displaying this page isn’t displaying it )
It’s kinda messed up that the bash code works in a script, but not in a crontab. I don’t understand why cron can’t handle the ambersand.
Another thing: Why is there no error reported in journalctl under crond when cron is obviously horking on something?
% is a special character meaning newline in crontab. See man crontab.5 about the crontab file format (not to be confused with man crontab which defaults to section 1, about the crontab program)