On 5/11/20 8:41 AM, Ed Greshko wrote:
On 2020-05-11 20:33, Robert Moskowitz wrote:
The biggie is no DATE: header.  And the MTA can only apply a DATE: header for 
the time it received the cron output.  The time the cron task started is lost.  
This is a bug in cron from day 1, it seems and I will be submitting this whole 
shebang as a bug.
Why not just have your crontab call a script?

#!/bin/sh

echo Start Time `date`

rsync .......

echo End Time `date`




I think if I run my rsync tasks within time, I would get this, but the problem is more the post processing.

Here is my post processing script so far:

local]# cat mycron
#!/bin/sh

exec 3>> /var/spool/mail/$USER
currentDate=$(date +'%a %b %d %T %Y')
echo "From cron@localhost  $currentDate" >&3
currentDate2=$(date +'%a, %e %b %Y %T %z (%Z)')
echo "Date: $currentDate2" >&3
(cat) >&3
echo "" >&3

I suspect I could add a couple of sed commands acting on file &3 to fix the FROM and TO headers, adding the hostname...

Probably could also work out something for a MESSAGE-ID header.

Oh, I am having selinux problems with this script for cron tasks run as root.  I have submitted a question about it to the selinux list.

_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org

Reply via email to