In a different controlpanel, I had the option in the cronjobs section to set the email address where the output should go.
In Virtualmin, I see the output will go to the main user by default.
Is there a way to change this? I thought to add the MAILTO option in the crontab of each user, but the first line clearly states: # DO NOT EDIT THIS FILE - edit the master and reinstall.
Iâm pretty sure that if you create cronjobs as the domain owner user, the domain owner user will get the emails?
I mean, if you login as a domain owner, you can only create and edit cron jobs owned by the domain owner (unless you grant them full access by adding them in the âExtra Webmin Modulesâ list) and those cronjobs, I would assume, would send email to the creator of those jobs.
I think they want the cron job result to go to a completely separate email address, eg his personal one. Saves having to check every domain-owner each day.
From Chat-GPT
If you want to send the output of a specific cron job to a different email address, you can redirect the output of the command to the mail command. Hereâs an example:
This will send an email with the subject âCron job outputâ to âyour.email@example.comâ with the output of /path/to/your/command whenever the cron job runs.
Please donât post ChatGPT output (I added this to the guidelines yesterday; it is a bannable offense, if it is posted without clearly noting it is ChatGPT, as weâve been getting a lot of spammers posting ChatGPT output to gain reputationâŠand, even if it is labeled, Iâd rather we not provide a pipeline for LLM-generated hallucinations directly into the forum).
ChatGPT is not always wrong, but itâs wrong enough of the time and in subtle enough ways that even I sometimes canât spot itâs wrong until I actually try it or check the docs. People are wrong just as often, but it feels better when people make mistakes, and I feel like weâre better able to judge how much someone knows from other context cluesâŠsomehow Iâm more easily fooled by ChatGPT than by people, even if the answers are similarly wrong.
It can even be useful. Iâve been doing âpair programmingâ with it lately, and Iâve gotten useful advice about Google Cloud, but only after some back and forth and experimenting to get it to stop giving me nice sounding hallucinations and start giving me facts. Sometimes, it never gets around to facts. I wasted a lot of time trying to use some Jenkins features that ChatGPT made up.
In short: Donât post ChatGPT output without trying it and understanding it, first. Then youâll be able to explain it in your own words. And, youâll often find out why it wonât actually work the way ChatGPT suggested, and spend some more time finding the way that would work.
just add the email address you want to send to an make sure itâs set to âbefore all cron jobsâ. I tend to use it for the root user so I can see the output of root cron jobs but it can be set for any user with any receiving email address set