<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Rotate accounting log? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158777#M93483</link>
    <description>Fredrik,&lt;BR /&gt;  Small caveat... &lt;BR /&gt;&lt;BR /&gt;$ set accounting /new_file&lt;BR /&gt;&lt;BR /&gt;  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):&lt;BR /&gt;&lt;BR /&gt;$ old=F$SEARCH(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"))&lt;BR /&gt;$ oldfid=F$FILE_ATTRIBUTES(old)&lt;BR /&gt;$ SET ACCOUNTING/NEW_FILE&lt;BR /&gt;$ SyncLoop: IF F$FILE_ATTRIBUTES(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"),"FID").EQS.oldfid&lt;BR /&gt;$ THEN&lt;BR /&gt;$   WAIT 0:0:1 ! 1 second delay&lt;BR /&gt;$   GOTO SyncLoop&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$!&lt;BR /&gt;$! At this point the rollover has completed&lt;BR /&gt;$! and the old file is free to be RENAMEd&lt;BR /&gt;$ RENAME 'old' whatever...&lt;BR /&gt;&lt;BR /&gt;(you may want to add a sanity check in case the rollover fails).</description>
    <pubDate>Mon, 23 Feb 2009 23:18:39 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2009-02-23T23:18:39Z</dc:date>
    <item>
      <title>Rotate accounting log?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158775#M93481</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As the topic says, is there anyway to rotate the accounting log (SYS$MANAGER:ACCOUNTNG.DAT) while having the system running?&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Mon, 23 Feb 2009 08:14:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158775#M93481</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-02-23T08:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate accounting log?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158776#M93482</link>
      <description>Found it myself, just googled way wrong :)&lt;BR /&gt;$ set accounting /new_file&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Mon, 23 Feb 2009 08:16:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158776#M93482</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-02-23T08:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate accounting log?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158777#M93483</link>
      <description>Fredrik,&lt;BR /&gt;  Small caveat... &lt;BR /&gt;&lt;BR /&gt;$ set accounting /new_file&lt;BR /&gt;&lt;BR /&gt;  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):&lt;BR /&gt;&lt;BR /&gt;$ old=F$SEARCH(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"))&lt;BR /&gt;$ oldfid=F$FILE_ATTRIBUTES(old)&lt;BR /&gt;$ SET ACCOUNTING/NEW_FILE&lt;BR /&gt;$ SyncLoop: IF F$FILE_ATTRIBUTES(F$PARSE("ACCOUNTNG","SYS$MANAGER:.DAT;"),"FID").EQS.oldfid&lt;BR /&gt;$ THEN&lt;BR /&gt;$   WAIT 0:0:1 ! 1 second delay&lt;BR /&gt;$   GOTO SyncLoop&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$!&lt;BR /&gt;$! At this point the rollover has completed&lt;BR /&gt;$! and the old file is free to be RENAMEd&lt;BR /&gt;$ RENAME 'old' whatever...&lt;BR /&gt;&lt;BR /&gt;(you may want to add a sanity check in case the rollover fails).</description>
      <pubDate>Mon, 23 Feb 2009 23:18:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/rotate-accounting-log/m-p/5158777#M93483</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-02-23T23:18:39Z</dc:date>
    </item>
  </channel>
</rss>

