I have an openSUSE Leap 15.6 soft RAID10 configured. When I run sudo logwatch --detail high --range yesterday --service mdadm I get the following output:
--------------------- Mdadm Begin ------------------------
/dev/md/system_raid10 : active
Raid Level : raid10
Good Devices : /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
---------------------- Mdadm End -------------------------
But when it’s run as a cronjob this is the output:
--------------------- Mdadm Begin ------------------------
/dev/md/system_raid10 :
Raid Level :
Spares :
---------------------- Mdadm End -------------------------
I also have PrivateDevices set to false:
systemctl show logwatch -p PrivateDevices
PrivateDevices=no
when it is so straightforward, then why do you have a problem.
I never use sudo , but are you sure that this is executed in the environment of the effective user and not using that of the invoking user? I don’t, this could very well be the crontab of the user you keep secret (by not posting the prompts).
when it is so straightforward, then why do you have a problem.
You’ve crystalized my thoughts exactly.
It doesn’t matter whether I use sudo, su -, or login as root, the result is the same. It’s only cron that isn’t working. And as I’ve demonstrated above, running sudo crontab -l shows that the job is defined and presumably running under the root profile. Furthermore, there are no cron jobs defined under the user account.
I got another idea from your first post. You say there that cron is working, the job is started. You only indicate that the output of the command that is run in the job is not according to your expectations.