After the SQL backup we run another task to run a batch file to zip the files and copy these onto a NAS. We keep the last 3 backups - the basic script looks something like:
d:
cd \MSSQL\BACKUP
zip -rq d:\northwind northwind.BAK
REM - do the local copy to the NAS
move/y \\10.0.0.1\sql_backup\yesterday\northwind.zip \\10.0.0.1\sql_backup\2DaysAgo\northwind.zip
move/y \\10.0.0.1\sql_backup\northwind.zip \\10.0.0.1\sql_backup\yesterday\northwind.zip
copy northwind.zip \\10.0.0.1\sql_backup\northwind.zip
(I've edited the script to only show 1 database). At the end of the script we call a Python script to send an email that tells us how big the backup files were and date they were created. You could easily use a WSH script instead. I think that the "if errorlevel..." instruction might have been added because the SQL agent doesn't always detect if the batch file completed or not?
if errorlevel 1 goto weakspace
d:\scripts\send_email_nas_copy_success.py
goto end
weakspace:
REM - error occured
d:\scripts\send_email_nas_copy_fail.py
end:
exit
One of our servers uses winrar instead of zip to compress the files (it has a command prompt). Once a month last night's backups are copied into an archive that's kept for six months, but you could easily create another batch file to run once a week to maintain backups of last Sunday, 2 Sundays ago and 3 Sundays ago.