Custom log shipping and 7z unzip

  • Hi,

    I am trying to implement custom log shipping but only have Standard Edition to am unable to use compressed backups..so have resorted to a customised version. As our transaction log files can reach several gb I need them zipped.

    I have managed to zip a file using xp_cmdshell as follows:

    exec master..xp_cmdshell 'C:\Progra~1\7-Zip\7z.exe a -t7z "D:\Microsoft SQL Server\MSSQL\Backup\archive_data.7z" "D:\Microsoft SQL Server\MSSQL\Backup\data.bak"'

    But I cannot get the syntax correct for unzipping the file.

    I've tried using similar code to above by replacing the 'a' with an 'e' or 'x' but get the following error:

    Cannot use absolute pathnames for this command.

    I've tried different pathnames but all generate similar errors, or simply do not recognise the path at all.

    Can any one point me in the right direction?

    Thanks,

    Jinx.

  • For future reference, this was solved with the following:

    EXEC MASTER..xp_cmdshell 'C:\Progra~1\7-Zip\7z.exe e "D:\Microsoft SQL Server\MSSQL\Backup\archive_data.7z" "-oD:\Microsoft SQL Server\MSSQL\Backup\"';

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

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