Competition: What’s your favorite Redgate tool? Enter now.

SQL Backup logs

DjeDje Posts: 13
Hi Everyone,

Is there an option to set up in order to have the logs called something like :
DBNAME_YYYYMMDD_HHMMSS instead of "ie : 20071128 183856 01.log" which is not really a speaking name ?

Thanks in advance for your replies,
Jerome

Comments

  • peteypetey Posts: 2,358 New member
    You can't do that to the default logs that are created. The reason being we need a definitive way to look for those logs. If users start naming them in other ways, we may never get the logs we want.

    Having said that, you can create a secondary set of logs using the LOGTO option e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE ... WITH LOGTO = [e:\dblogs\<database>_<datetime yyyymmdd_hhnnss>.log]"'
    
    Note that minutes are represented by the symbol nn, not mm.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Thanks petey.
    It works fine.
    Let's implement this :)
Sign In or Register to comment.