Find the path of a shell command
Albert-Jan Roskam
sjeik_appie at hotmail.com
Fri Oct 14 13:57:45 EDT 2022
On Oct 14, 2022 18:19, "Peter J. Holzer" <hjp-python at hjp.at> wrote:
On 2022-10-14 07:40:14 -0700, Dan Stromberg wrote:
> Alternatively, you can "ps axfwwe" (on Linux) to see environment
> variables, and check what the environment of cron (or similar) is. It
> is this environment (mostly) that cronjobs will inherit.
The simplest (and IMHO also most reliable) way to find out the
environment a cronjob has is to write a cronjob which just dumps the
environment.
=====
Lately I've been using systemd timers instead of cronjobs. They are easier
to debug (journalctl) but require a bit more work to write. Systemd is
available on Fedora & friends and Debian based systems, maybe more. It has
no builtin MAILTO. I use an OnFailure stanza to send a Slack message with
curl instead.
https://www.freedesktop.org/software/systemd/man/systemd.timer.html
https://unix.stackexchange.com/questions/278564/cron-vs-systemd-timers
More information about the Python-list
mailing list