How to disable cron emails, but only for logrotate only not for other logs?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to disable cron emails, but only for logrotate only not for other logs?
# 1  
Old 04-08-2015
How to disable cron emails, but only for logrotate only not for other logs?

Guys, is there a script or command?

how to disable cron emails, but only for logrotate only not for other logs
# 2  
Old 04-08-2015
Cron mails you your output. To prevent the creation of mail messages from cron, don't generate any output. Redirect stdout and stderr to /dev/null for those commands you never want to see mail for.
# 3  
Old 04-08-2015
true, but only exist in user's crontab ..

but what if a system logs?

like for example,



in /etc/cron.daily

you have

Code:
logrotate
cleaner


Then you only want to disable the email of /etc/cron.daily/logrotate not the others

Last edited by Don Cragun; 04-08-2015 at 05:26 PM.. Reason: Add CODE and ICODE tags, again.
# 4  
Old 04-08-2015
Did you consider to empty the MAILTO variable? man cron:
Quote:
If MAILTO is defined but empty (MAILTO=""), no mail will be sent.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Logrotate with catalina.out "daily compressed file is overwriting the logs"

Hi Everyone, We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is... (2 Replies)
Discussion started by: thiyagoo
2 Replies

2. Debian

Logrotate truncated my log files to 0 bytes and no logs are written

Hi, Yesterday I installed and configured logrotate on my Debian machine. I was expecting this to run at 06:25 in the morning and it actually did. All my old logs were compressed and zipped but the new logs were all with size equal to 0 bytes. Processes, while still running ok, they were not... (2 Replies)
Discussion started by: pmatsinopoulos
2 Replies

3. UNIX for Dummies Questions & Answers

logrotate and cron.daily/weekly

Hi guys, I've got two separate logrotates I'd like to run, one for Tomcat and one for Apache, but I'd like to run the Tomcat one daily and the Apache one weekly. Now, the logrotate itself is working fine, but although I have 'daily' in Tomcat, and 'weekly' in the Apache one, the latter is... (2 Replies)
Discussion started by: jimbob01
2 Replies

4. SuSE

Which logs to logrotate?

Hi all We've had new servers coming in and one of the requirement was to keep logs for up to 8 months. I know logrotate can do the job, but by default (on Suse Enterprise10, 11) we have these logs in /etc/logrotate.d dir as default logs which are rotated: -rw-r--r-- 1 root root 140 Jul... (0 Replies)
Discussion started by: hedkandi
0 Replies

5. Solaris

Disable all the logs in Solaris

Hi Is there anyway to disable all logs/logging (lastlog, sulog, messages etc.) in Solaris 9&10? I know this is not recommended but i just want to know if this is possible. TIA Reddy (8 Replies)
Discussion started by: reddyr
8 Replies

6. UNIX for Dummies Questions & Answers

disable cron job

Hi all, I am not the unix person but have to disable cron job on the server I typed crontab -l to list the job there is one job then i tried crontab -e and got one result 100 ( i do not know what that means) how can i disable the job to run i want to disable the job. Please show me... (3 Replies)
Discussion started by: patdev
3 Replies

7. UNIX for Advanced & Expert Users

cron/logrotate chicken and egg problem

I have run into a problem where about a dozen machines, all the same x86_64 2.6.12 GNU/Linux. For some reason these machines will fill up their /var partition (10G), because their logs never get rotated... Unfortunately, there is no error message from logrotate (would be in /var/log/messages) and... (8 Replies)
Discussion started by: jjinno
8 Replies

8. UNIX for Advanced & Expert Users

How to disable application level logs in Unix?

Hi, I'm working in an application and the related Java code and the envrionment is in Unix server. We are generating the log messages using loggers of Java.util.log . But, the logs are not getting generated in the log files. We feel that the people who developed the system might have done some... (6 Replies)
Discussion started by: kelangovan
6 Replies

9. UNIX for Dummies Questions & Answers

Delete Old Spam Emails Custom Cron

Hey Guys, I've done some research however I got stuck. My goal is to create a cron job that runs every hour and goes through all web accounts on my server and deletes spam emails that are older than 3 days. This is what I came up with: 0 * * * * find /home/*/mail/*/*/.spam/cur/* -type f... (0 Replies)
Discussion started by: plxkarl
0 Replies

10. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies
Login or Register to Ask a Question