- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Log file is emptied in var/adm/cron/log
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
Forums
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
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
тАО10-14-2002 08:02 PM
тАО10-14-2002 08:02 PM
Last week, I was doing some housekeeping on my own that empty the log file in /var/adm/cron. Unfortunately, no logs were generated since then. I checked with modes and ownership, it remains the same. How can I trigger the log files again ? Thanks. I was supposed to have a log generated in my cronjobs in every five minutes.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2002 08:14 PM
тАО10-14-2002 08:14 PM
Re: Log file is emptied in var/adm/cron/log
Did you try to restart the cron daemon to 'kick start' the log file again ?
Regards,
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2002 08:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2002 08:27 PM
тАО10-14-2002 08:27 PM
Re: Log file is emptied in var/adm/cron/log
After restarting the cron daemon, you should see something in the log file
! *** cron started *** pid = 1333 Mon Oct 14 18:09:55 EAT 2002
Regards,
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 04:34 AM
тАО10-15-2002 04:34 AM
Re: Log file is emptied in var/adm/cron/log
You've got the answer but I thought you may like a little more info.
/var/adm/cron/log is one of a number of system log files that are held open by a process. If you delete the file and re-create it, the process (in this case cron) is still trying to write to the file you deleted.
Before removing a file, you should use fuser or lsof on that file to see if something has it open. It's best to stop the processes holding the file open, do your house-keeping, then restart the process. In a pince, you could simply empty the file with ">/var/adm/cron/log".
One other note. Even though you re-created /var/adm/cron/log and its size was not increasing, the size of the old log was increasing. Remember, cron had the file open and was still writing to it. bdf would reflect this. du would not. Only when you stopped cron was the space released.
Generally, cron's log won't take enough space to matter but a busy log (such as /var/adm/syslog/syslog.log) will cause you problems.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 07:40 PM
тАО10-15-2002 07:40 PM
Re: Log file is emptied in var/adm/cron/log
How can I empty a log file (system ones) safely ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2002 02:27 AM
тАО10-16-2002 02:27 AM
Re: Log file is emptied in var/adm/cron/log
There unfortunately isn't a truly standard way to do this. It depends on which application is writing the log file and how that application was written. Stopping and restarting the application is one way, though you have to ask yourself what the consequences of that are for any particular process. (Will your system suffer any ill effects if that service isn't available for the time it takes to restart the program?)
In many cases, daemons are written such that sending them a SIGHUP signal will cause them to close and reopen their configuration files. For example, the manual page for
syslogd says:
"To make syslogd, re-read its configuration file, send it a HANGUP
signal:
kill -HUP `cat /var/run/syslog.pid`"
If the application in question supports this, it is usually the preferred way of handling the log file pruning problem, because the application doesn't terminate. It just gets notified that it needs to close and reopen the log file, which can usually be done in a fraction of a second without hurting any currently active operations. In this case you
could so something like:
mv logfile logfile.old
touch logfile
chown/chmod logfile as appropriate
kill -HUP
Verify that logfile is growing and that
logfile.old isn't, then archive, compress
or delete logfile.old as appropriate.
An alternative is to edit the boot scripts such that log files are pruned each time the system reboots. If something like a monthly reboot is not a problem for your system, you can automate the log file trimming. If that's not possible, the SIGHUP or stop/start approaches can be used.