On 5/10/20 11:39 PM, Ed Greshko wrote:
On 2020-05-07 06:00, Robert Moskowitz wrote:
I know I can edit the user crontab with:

crontab -e

and display it with

crontab -l

But where is it?  I don't see anything like ~/.crontab

Secondly, and more importantly, is getting a email from the user crontab.  I 
have in my crontab:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=rgm


And nothing gets mailed to /var/spool/mail/rgm

ls /var/spool/mail/ -ls
total 0
0 -rw-rw----. 1 rgm mail 0 May  5 17:21 rgm
0 -rw-rw----. 1 rpc mail 0 May  5 17:07 rpc


Do I need something like postfix with a minimal installation to get the output 
from my crontab?

Sorry to be "late to the party".

I did the following....

dnf install postfix
systemctl --now enable postfix

And now you are paying the memory, cpu, etc. cost of having postfix running for something that a postprocessing MDA should/can do.  Plus you are showing that cron is not working "out of the box" as well as it should without an MTA or a proper MDA.


My crontab....

SHELL=/bin/sh
MAILTO=egreshko
37 * * * * /home/egreshko/bin/tippy

Contents of /home/egreshko/bin/tippy

[egreshko@f31k ~]$ cat bin/tippy
#!/bin/sh

echo HI

ls /tmp

And then you can see the time has past with...

[egreshko@f31k ~]$ date
Mon 11 May 2020 11:38:01 AM CST

And this showed up in local mailbox

[egreshko@f31k ~]$ cat /var/spool/mail/egreshko
 From egres...@f31k.greshko.com  Mon May 11 11:37:01 2020
Return-Path: <egres...@f31k.greshko.com>
X-Original-To: egreshko
Delivered-To: egres...@f31k.greshko.com
Received: by f31k.greshko.com (Postfix, from userid 1026)
         id 61824A7C95; Mon, 11 May 2020 11:37:01 +0800 (CST)
From: "(Cron Daemon)" <egres...@f31k.greshko.com>
To: egres...@f31k.greshko.com
Subject: Cron <egreshko@f31k> /home/egreshko/bin/tippy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=34>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/1026>
X-Cron-Env: <DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1026/bus>
X-Cron-Env: <XDG_SESSION_TYPE=unspecified>
X-Cron-Env: <XDG_SESSION_CLASS=background>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <MAILTO=egreshko>
X-Cron-Env: <HOME=/home/egreshko>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=egreshko>
X-Cron-Env: <USER=egreshko>
Message-Id: <20200511033701.61824a7...@f31k.greshko.com>
Date: Mon, 11 May 2020 11:37:01 +0800 (CST)

HI
sddm-:0-WDrvkF
sddm-auth43c5c6d5-ceb7-4e5b-b09f-abe5c864fba1
systemd-private-a3fcb3cdd0024b53828446634851314a-chronyd.service-5olExh
systemd-private-a3fcb3cdd0024b53828446634851314a-colord.service-759pOi
systemd-private-a3fcb3cdd0024b53828446634851314a-dbus-broker.service-2c7ROg
systemd-private-a3fcb3cdd0024b53828446634851314a-ModemManager.service-e8g5zi
systemd-private-a3fcb3cdd0024b53828446634851314a-postfix.service-tkOnQf
systemd-private-a3fcb3cdd0024b53828446634851314a-rtkit-daemon.service-vXKr2h
systemd-private-a3fcb3cdd0024b53828446634851314a-systemd-logind.service-jmYKHf
systemd-private-a3fcb3cdd0024b53828446634851314a-upower.service-24SETg


Isn't that what you wanted?

Without the fun and games of an MTA.  I could easily do this.  I have done this for past installs.  This time I am trying to figure this out without the MTA bandaid; an MDA like procmail SHOULD do this right.  In fact someone did part of the job by adding the "-f cron" option to procmail.



_______________________________________________
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