how to zip the last backup file from a device | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

how to zip the last backup file from a device

Hi, I have a maintenance plan and implicit a daily backup, at 22 PM.
I want to take this backup (the last backup from device), to zip and to send the file to a second server, unzip and restore the file.
My problem is that I don#%92t know how to put this file into my variable.
Any idea?
Thanks for the help

Maintenance plan appends timestamp to the backup file name. So, it’s hard to predict the exact file name. It will be easy if you manually schedule these backups and give a fixed file name for the backup.
unless you use xp_cmdshell and the dir command to get the latest backup file and zip that up? Cheers
Twan
For installations where disk space is limited and time is of the essence take a look at SQL LiteSpeed. The enhancements you get by using this product can benefit every SQL Server installation. You can find more information about SQL LiteSpeed athttp://www.sqllitespeed.com/. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Hi,
Thanks very much for your help.
I will use robocopy command and I will not zip the file.
But I have another question: how can I delete the backup files older then 7 days.
Thanks again.

You can define that in the maintenance plan to delete old backup files. http://www.nigelrivett.net/BackupAllDatabases.html – handy script for information. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>