I have the non-enterprise edition of SQL Server 2008. I do nightly backups, manually zip the files and then manually copy to a remote server.
I need to automate this using batch files. Copying files from server to server is easy but how do I automate the zipping of the backup first?
The full process I need is:
I confess the compression part has thrown me off. Any advice would be very much welcomed.
Thanks in advance.
You can backup databases with SQLBackupAndFTP software. It's a simple UI tool with ability to execute and schedule backup jobs (full, diff and log tran backups). It just compresses backups with embedded archiver or 7-zip and send to a local folder or to a NAS drive or FTP or a to a cloud (Dropbox, Google Drive, Amazon S3). Also there is support forum.
You could (and should!) most definitely investigate the SQL Server maintenance plans.
These allow you to automate things like
I'm not sure if they have built-in support for zipping and copying to a remote server, but you could definitely automate the backup part with a maintenance plan, and the rest with a command file of some sort.
you do not specify the zip utility that you are using. There are many, but I tend to use Winzip as that is the main zip tool used at work. Winzip has a command line interface ( http://www.winzip.com/prodpagecl.htm ) that is a free addin to winzip that can be called from a command line.
Another alternative would be to use cygwin and tar.gz via the command line.
If you are just stuck on how to compress from a batch script:
To get a unique filename, I usually embed the date/time: yyyymmddhhMMss-backup.7z
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With