SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 SQL Agent log file rollover
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dmaxj
Posting Yak Master

174 Posts

Posted - 01/19/2014 :  20:27:42  Show Profile  Reply with Quote
I have enabled verbose logging for an SQL Job related to transactional replication... The log file is starting to get rather large.

Is there a way to have the log file rollover once the log file reaches a certain size?

Regards

dmaxj
Posting Yak Master

174 Posts

Posted - 02/05/2014 :  11:32:25  Show Profile  Reply with Quote
Here is a short solution to this issue - POWERSHELL! I ran this script from an SQL Job to append a date and timestamp to the end of the log file.
The job runs once per day... Cheers...

$DateFileName = GET-DATE -FORMAT yyyy-MM-dd_hhmmss
Rename-Item <path>\<filename>.log -newname ("<filename>" + $DateFileName + ".log")

Edited by - dmaxj on 02/05/2014 12:43:00
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000