sp_BackupDatabases can be found here: http://support.microsoft.com/kb/2019698
database_backup.bat
md c:\temp_database_bak sqlcmd -S {{MACHINE_NAME}}\SQLEXPRESS -Q "EXEC sp_BackupDatabases @backupLocation='c:\temp_database_bak\', @backupType='F'" FOR %%A IN (%Date%) DO ( FOR /F "tokens=1-3 delims=/-" %%B in ("%%~A") DO ( SET Today=%%D%%B%%C ) ) "C:\Program Files\7-Zip\7z.exe" a c:\backup_mssql\Database_BAK.%TODAY%.7z "C:\temp_database_bak\" rmdir c:\temp_database_bak /S /Q
No comments:
Post a Comment