Sysax Product Forums / Sysax Multi Server / General Discussion / Roll Over Log Files by Date
Posted:  07 Mar 2011 21:44
For anyone interested in rolling over their log files daily instead of by size, I've come up with a way to do so.  My script stops the Sysax Multi Server Service, waits 10 seconds, copies the log file from one location to another while also adding the date to the beginning of the filename, clears the contents of the log, then starts the Sysax Multi Server Service.

My script contains the following:
net stop "Sysax Multi Server Service"
choice /c:@ /n /t:@,10
copy e:\Sysax_SFTP_Logs\sysaxservd.log e:\Sysax_SFTP_Logs\Archive\%date:~4,2%-%date:~7,2%-%date:~12,2%_sysaxservd.log
echo. > e:\sysax_sftp_logs\sysaxservd.log
net start "Sysax Multi Server Service"
Posted:  22 Jul 2011 05:04
Thanks
 

Copyright © 2021 Codeorigin, LLC - All Rights Reserved.
XML RSS 2.0 XML Atom 1.0