- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Automatically "recreate" mail.log on reboot ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:30 AM
тАО03-05-2004 05:30 AM
Can I set something up to do the same thing for "mail.log"?: move mail.log to OLDmail.log and create a new mail.log?
Is there some flag to do that?
Our "mail.log" files get so big that they become a problem. We don't trim them in cronjobs - what do you do?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:31 AM
тАО03-05-2004 05:31 AM
Re: Automatically "recreate" mail.log on reboot ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:34 AM
тАО03-05-2004 05:34 AM
Re: Automatically "recreate" mail.log on reboot ?
You may have to use cron
you can copy the file to different location (and gzip it)then reset with
> mail.log
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:35 AM
тАО03-05-2004 05:35 AM
Re: Automatically "recreate" mail.log on reboot ?
You'll have to add code to the /sbin/init.d/sendmail script - like
mv /var/adm/syslog/mail.log /var/adm/syslog/OLDmail.log
This is the way syslog startup does it.
NOTE: these scripts are fair game for overwrite on patch installs or upgrades.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:35 AM
тАО03-05-2004 05:35 AM
Re: Automatically "recreate" mail.log on reboot ?
There isn't any script that will move mail.log file through startup. You can configure one that will do it for you. Make sure that script starts before syslogd script though by putting the links with lower number than syslogd in sbin/rc2.d directory.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:38 AM
тАО03-05-2004 05:38 AM
Re: Automatically "recreate" mail.log on reboot ?
> /var/adm/syslog/mail.log
Later,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:44 AM
тАО03-05-2004 05:44 AM
Re: Automatically "recreate" mail.log on reboot ?
you will want to stop syslogd and then you can mv mail.log like syslog.log.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:47 AM
тАО03-05-2004 05:47 AM
Re: Automatically "recreate" mail.log on reboot ?
if [ -f /var/adm/syslog/syslog.log ]; then
mv /var/adm/syslog/syslog.log /var/adm/syslog/OLDsyslog.
log
mask=`umask`
umask 022
> /var/adm/syslog/syslog.log
umask $mask
fi
But, as someone pointed out above, we reboot some servers every other weekend, but some servers we NEVER reboot. So, I'll probably do a cronjob.
Thanks for your help...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 05:49 AM
тАО03-05-2004 05:49 AM
Re: Automatically "recreate" mail.log on reboot ?
1. It could be overwritten. swinstalls won't overwrite /sbin/init.d/ files. But you may yourself replace it with a new version later.
2. syslogd that holds locks on this file starts before sendmail.
So, it's better to write a seperate script that starts before syslogd in my 2 cents opinion.
-Sri