I think the only way is to have your cronjob do the emailing of the output, and then delete (or move) the output file so it's not repeated on the next run. Something like:
#!/bin/bash
## Call actual job script here. ./do-tool-things.sh
## Email output to maintainers. echo -e 'Subject: [tools.toolname] Job output\nContent-Type: text/plain; charset=UTF-8' | cat - /data/project/toolname/cron-tools.jobname.out | /usr/sbin/exim -odf -i tools.toolname@tools.wmflabs.org
## Remove output file. rm /data/project/toolname/cron-tools.jobname.out
Although of course the details might differ for different tools.
On 22/6/21 4:52 pm, Shrinivasan T wrote:
Hello all,
I have a bot at toolforge, running weekly once in cron job using "jsub"
Followed the below link for the setup. https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot
Getting the JOBNAME.out and JOBNAME.err files at the home folder.
Is there any other way like email notification to get alerts, if some error happens?
I think the files JOBNAME.out and JOBNAME.err will be keep on growing on the bason host login.toolforge.org
How to avoid this?
Thanks.