0

I just setup a cronjob in /var/spool/cron/crontabs/root which is running fine. But when the cron starts I always get an email with following contents:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed

 0     0    0     0    0    28      0  11340 --:--:-- --:--:-- --:--:-- 11340
 0 75 0 75 0 28 8480   3165 --:--:-- --:--:-- --:--:--  7833
{"status": "ok", "jobs": {"mdspider": "e8ce7498dc5e11e0b387b3171f8e7a38"}}

Where can I disable that and enable email transmission only if the cronjob fails?

3

Cron will send you any output from your job; it is your task to write a job which doesn't spew spurious output. This looks vaguely like a Python script driving curl or maybe rsync; add a -q option to the script, or redirect its output to /dev/null. But take care to only ditch harmless messages! People tend to throw away error messages, and then wonder why their job fails "silently". A good practice is to log output to a file, and rotate the log file periodically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.