HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Rotate accounting log?
Operating System - OpenVMS
1826703
Members
2919
Online
109696
Solutions
Forums
Categories
Company
Local Language
back
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
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
02-23-2009 12:14 AM
02-23-2009 12:14 AM
Rotate accounting log?
Hi,
As the topic says, is there anyway to rotate the accounting log (SYS$MANAGER:ACCOUNTNG.DAT) while having the system running?
For some reason the file hasn't been renewed when the machine been rebooted and still contain entries from 2004. To make this abit more manageable I would like to start a new accounting file if that is possible.
Best regards
Fredrik Eriksson
As the topic says, is there anyway to rotate the accounting log (SYS$MANAGER:ACCOUNTNG.DAT) while having the system running?
For some reason the file hasn't been renewed when the machine been rebooted and still contain entries from 2004. To make this abit more manageable I would like to start a new accounting file if that is possible.
Best regards
Fredrik Eriksson
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2009 12:16 AM
02-23-2009 12:16 AM
Re: Rotate accounting log?
Found it myself, just googled way wrong :)
$ set accounting /new_file
Best regards
Fredrik Eriksson
$ set accounting /new_file
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2009 03:18 PM
02-23-2009 03:18 PM
Re: Rotate accounting log?
Fredrik,
Small caveat...
$ set accounting /new_file
is not synchronous. Therefore, you cannot be guaranteed the old file is closed or the new file opened at completion of the command. If you're scripting a rollover, and wish to do something with the old version, you need to synchronize. Something like (untested):
$ old=F$SEARCH(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"))
$ oldfid=F$FILE_ATTRIBUTES(old)
$ SET ACCOUNTING/NEW_FILE
$ SyncLoop: IF F$FILE_ATTRIBUTES(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"),"FID").EQS.oldfid
$ THEN
$ WAIT 0:0:1 ! 1 second delay
$ GOTO SyncLoop
$ ENDIF
$!
$! At this point the rollover has completed
$! and the old file is free to be RENAMEd
$ RENAME 'old' whatever...
(you may want to add a sanity check in case the rollover fails).
Small caveat...
$ set accounting /new_file
is not synchronous. Therefore, you cannot be guaranteed the old file is closed or the new file opened at completion of the command. If you're scripting a rollover, and wish to do something with the old version, you need to synchronize. Something like (untested):
$ old=F$SEARCH(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"))
$ oldfid=F$FILE_ATTRIBUTES(old)
$ SET ACCOUNTING/NEW_FILE
$ SyncLoop: IF F$FILE_ATTRIBUTES(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"),"FID").EQS.oldfid
$ THEN
$ WAIT 0:0:1 ! 1 second delay
$ GOTO SyncLoop
$ ENDIF
$!
$! At this point the rollover has completed
$! and the old file is free to be RENAMEd
$ RENAME 'old' whatever...
(you may want to add a sanity check in case the rollover fails).
A crucible of informative mistakes
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP