Re: Getting crontab to send an email

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

 



On Thu, 26 Jun 2025 at 22:50, Robert Moskowitz via users <users@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have an Ubuntu server with logwatch installed, so it has all the
'right' postfix setups and I get daily logwatch reports.

I also added a cron shutdown as follows:

10 4    * * *   root    /usr/sbin/shutdown

And I get a daily email saying the system will shutdown in ~1min. Nice.

I want to get emails from my Fedora notebook for crontab activities.  I
particular, I want to do a nightly rsync to an rsynd and get the results
of this printed.

something like:

10 4    * * *   rgm    /usr/bin/time --password-file=pasw --verbose
/usr/bin/rsync -ah --stats /home/rgm/r/ rsync://rgm@homestor/rgm/r/

should do it for the rsync; in fact it does rsync the files, but no
report is emailed.  Not local or other.

First figure out if your MTA is working, then you can figure out what you want to *actually* send, whether Logwatch rolled-up reports, or just the individual crontabs. There's almost certainly a bunch of ways you can slice this. 

If you try just sending a mail using mailx (installing first, if necessary), on the Fedora system does that work? cf: https://commandmasters.com/commands/mailx-common/

Once you know if Postfix works, then if it doesn't, you can examine your working Postfix setup from the other machine and port over. 

Is your preference to have Logwatch on Fedora do the same thing it's doing on your Ubuntu machine? Or just have that single crontab for Fedora send mail? 

If it's the latter, *then* you can either add MAILTO to your crontab (https://www.cyberciti.biz/faq/linux-unix-crontab-change-mailto-settings/), or just pipe the output to mailx.

Or alternatively, configure Logwatch (which I haven't done for a LONG time but I remember it not being terribly hard.) If you fix your MTA it'll probably Just Start Working I suspect.
-- 
_______________________________________________
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
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
[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