Zipped Backup File

  • Hi All,

    I want to make use of the command line zipper through xp_cmdshell procedure. The database backup file will be taken from the source directory and after zipping, it should be sent to a destination directory.

    Any help in this regard is highly appreciated as I have to make the necessary process and send it to the client so that the weekly full backup will be mailed to my end directly and the same has to be restored for auditing purpose.

    The matter is urgent.

    Ravi


    Lucky

  • Hi All,

    Nobody has responded. I am providing the requirement in detail.

    Since 3 days i am trying to write a process by using XP_CMDSHELL external procedure to zip files.

    My ultimate requirement is to zip the database backup file which is present in one directory and save the zipped file into another directory. For this i should be able to execute the command line zipper ("WZZIP") from any path ie., may be at the root level or the next higher level.

    I have done the following steps. If anything to be changed, kindly guide me.

    1. Took a database backup of size 977 kb which is in D:\Database Files path

    2. Installed the command line zipper add-on support for Winzip 8.1 in C:\WINNT\SYSTEM32

    3. Set the path in the sytem variables to C:\WINNT\SYSTEM32

    4. Wrote the following code for zipping process.

    DECLARE

    @SRCEFILEVARCHAR(100),

    @DSTFILEVARCHAR(100),

    @CMDLINEVARCHAR(100),

    @CMDVARCHAR(20)

    SELECT@DSTFILE= '"D:\DATABASE FILES\DBBKUP\DB.ZIP"'

    SELECT@SRCEFILE= '"D:\DATABASE FILES\Test_db_200305140203.BAK"'

    SELECT@CMD= 'WZZIP '

    SELECT@CMDLINE= @CMD + @DSTFILE + ' ' + @SRCEFILE

    --SELECT @CMDLINE

    EXECMASTER..XP_CMDSHELL @CMDLINE

    5. When i execute at the dos prompt with the following syntax, it is executing fine.

    WZZIP "D:\DATABASE FILES\DBBKUP\DB.ZIP" "D:\DATABASE FILES\Test_db_200305140203.BAK"

    I am using Windows 2000 Server with SQL Server 2000 SP 2, using default sa login for SQL Server.

    The matter is urgent. I have to design the necessary process document to be sent to the client. Pl respond.

    Ravi


    Lucky

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply