Re: formail - Re: Fedora 32 no MTA, CRON output and procmail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux