REM change directory to the sql backup file location
cd /d d:\whateverdir\whateversubdir
REM loop through all the BAK files and run your statement so that each
file backs up to a unique file name
for %%i in (dir *.bak) do call commandline %%i.zip
REM you can also delete your BAK files once you have ZIPs of them
REM COMMENTED FOR SAFETY for %%i in (dir *.bak) do call del %%i
-----
You need to figure out what the commandline is for your winzip statement
(which I think I see below -- but I didn't know where to stick the
filename), and then insert the %%i.zip for the filename in the "for"
line above.
As to the FREE is sometimes better than good comment, the correlary to
it is "You get what you pay for".
Batch scripting isn't always perfect.. EXEs sometimes don't provide you
with error codes or tell you that they have failed, or lost network
connectivity half-way through your free process. It's always a concern
when writing something as important as backups with "free" tools.
Always monitor your solutions.. Always test your solutions.. Always
know that something can and usually does go wrong eventually.
Steven
> -----Original Message-----
> From: Jumma Salim
> [mailto:mssqldba-ezmlmshield-x59395272.[Email address protected]
> Sent: Tuesday, January 31, 2006 1:44 PM
> To: LazyDBA Discussion
> Subject: RE: backup over server
>
> Yes I am trying to do the same
>
> Here is my script running on remote server Original file is drive W
> (source) To be moved to drive D (destination)
>
> How do I get the name of zip file same as the .bak file
>
> C:\>"c:\winzip\WZZIP" "d:\Microsoft SQL Server\MSSQL\BACKUP\"
-t -ee w:\Microsoft SQL Server\MSSQL\BACKUP\*.bak"
>
>
> 2 question
> Can you share your script?
>
> Do you run 2 Database Maintenance plan to back up database ?
>
> -----Original Message-----
> From: Sheldon Jeff [mailto:[Email address protected]
> Sent: Tuesday, January 31, 2006 3:24 PM
> To: Jumma, Salim
> Subject: RE: backup over server
>
> **A LazyDBA.com subscriber has responded to your lazydba.com
> post** **LazyDBA.com mail shield has forwarded you this
> email, **and removed any attachments, and kept your email
> address secret **from this person, and any viruses/trojans.
> **If you reply to this email, the person will see your email
> address as normal **Anything below this line is the original
> email text
>
>
> Jumma,
>
> Backing up to a remote server will crap out even using UNC
> path. When the size of the file reaches a certain point you
> will receive a message like 'Unable to apply /837483438.TRN
> or .BAK' the reason is that the destination server 'times
> out' when the backup is occuring. (this is the cliff note
> version of it)
>
> What we do is backup files/trans logs to the same server (different
> drive) and then run a script to zip up the files. Then send
> the files to the remote server. On the remote server we then
> unzip the files then continue to restore a database as you
> would if you didn't zip.
>
> It has worked for us for over a year.....
>
>
> Jeff
>
> -----Original Message-----
> From: Jumma Salim
> [Email address protected]
> Sent: Monday, January 30, 2006 10:32 AM
> To: LazyDBA Discussion
> Subject: backup over server
>
> Can I make a backup plan to backup to a different server by
> mapping a drive to database server say T drive
>
>
>
> Mapped drive does not show when I make Maintenance plan?
>
>
>
>
>
> If I do through query analyzer it will not do all step that I
> can easily do in maintenance plan?
>
>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> Website :
> http://www.LazyDBA.com To unsubscribe:
> http://www.lazydba.com/unsubscribe.html
>
>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> Website : http://www.LazyDBA.com To unsubscribe:
> http://www.lazydba.com/unsubscribe.html
>
>
>
>
MS Sql Server LazyDBA home page