How can we help you today? How can we help you today?

Backing up Logs for multiple databases.

To do either a full or diff backup of all my user databases I can use:
EXECUTE master..sqlbackup '-SQL "BACKUP USER DATABASES TO DISK....

What's the proper way to do Log backups on all user databases? When I look at the BACKUP command page on Red Gate Support, I don't see an option to use USER DATABASES listed for log backups.

Can someone clarify what's the proper syntax?

Is it:
EXECUTE master..sqlbackup '-SQL "BACKUP USER LOGS TO DISK....
???
jhboricua
0

Comments

2 comments

  • petey
    Try
    EXEC master..sqlbackup '-sql "BACKUP LOGS [*] TO ..." '
    
    petey
    0
  • jhboricua
    Thanks petey. That worked, except that the model database was included in the list of databases that was backed up.

    After some more reading I found that doing:
    EXECUTE master..sqlbackup '-SQL "BACKUP LOGS EXCLUDE [model] TO ....
    

    was the way to go. This backs up all my user databases while excluding the model database.
    jhboricua
    0

Add comment

Please sign in to leave a comment.