How To Rollover System ErrLog
1. Locate and check the size of the current ERRLOG.SYS file:
$ SET DEFAULT SYS$ERRORLOG $ DIRECTORY /SIZE /DATE /PROTECTION ERRLOG*.* Directory SYS$SYSROOT:[SYSERR] ERRLOG.OLD;15 4374 22-DEC-2017 11:26:05.97 (RWED,RWED,RE,) ERRLOG.OLD;14 97 8-DEC-2017 11:26:04.89 (RWED,RWED,RE,) ERRLOG.OLD;13 219 17-MAY-2010 16:42:34.30 (RWED,RWED,RE,) ERRLOG.SYS;1 282 9-NOV-2018 09:50:42.14 (RWED,RWED,RE,) Total of 4 files, 4972 blocks.
2. Create a new version of the ERRLOG.SYS logfile simply by RENAME
-ing the ERRLOG.SYS file – Don't worry, VMS will notice and create a new version of ERRLOG.SYS the very next time it needs to write-out a buffer of errlog information:
$ RENAME /LOG ERRLOG.SYS *.OLD %RENAME-I-RENAMED, SYS$SYSROOT:[SYSERR]ERRLOG.SYS;1 renamed to SYS$SYSROOT:[SYSERR]ERRLOG.OLD;16
3. Purge old file versions to free up space – keep as many recent versions as you like, but consider whether you'll ever actually need to investigate events in those older files (it hardly ever happens, but again, YMMV).
$ PURGE /KEEP=2 ERRLOG.OLD
The practical, forensic or diagnostic utility of any version of ERRLOG.OLD drops rapidly beyond the top-version of that file, so don't keep more than a couple of these file-versions.
Done.
How Often Should ERRLOG.SYS Be Rolled-Over?
Different systems and business environments have different operational requirements, but here are a few rules of thumb, and your own specific requirement is likely a combination of two or more of these:
- Whenever the System Error Logfile size gets larger than “a few hundred-KB (kilobytes).”
- Occasionally when trying to diagnose an intermittent or creeping hardware failure.
- Monthly.
- Quarterly.
- Maybe even annually.
- With every system reboot (not suitable for systems which run for months or years without rebooting); often, the ERRLOG.SYS rename/rollover command is included in the system's SYS$MANAGER:SYSHUTDWN.COM script, so this file gets rolled-over before each reboot.