PK Zip

  • how do i zip up a file in a schedule job, so the file can be open on a unix machine i have done it via winzip but it will not open on the unxi machine, would pkzip work ?

  • Use 7zip (http://www.7-zip.org).

    In the command line options of the 7za.exe you have different compresion options to zip to different platforms (Windows, Unix)

  • Or if you can't install stuff on the unix machine, try installing Cygwin on your windows box (or get a native port) of gzip.  gzip is pretty much standard on all unix machines.  Many of them also have bzip2.  If you can do stuff to the unix machine, 7zip would certainly be a strong contender!

  • Did I miss the Sequel Server TSQL bit of this thread?

    Have fun

    Steve

    We need men who can dream of things that never were.

  • Just to answer the original question:

     

    declare @cmd varchar(255)

    create table xp_cmd_output (xp_output_line varchar(255))

    set @cmd="your winzip/pkzip/7zip/winrar/etc command line string"

    insert into xp_cmd_output

        exec xp_cmdshell @cmd

    select * from xp_cmd_output

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Before you give up on Winzip (if that's what you have to work with), try again at a lower compression level.  The highest compression level is a proprietary format, but the lower levels should be compatible.  You need to get the command-line addon for Winzip to run it easily from a scheduled job, if this is a problem then switch to one of the more Unix-friendly alternatives.

    Are you sure the file was not corrupted during transfer?  Did you use FTP without specifying Binary mode?

  • Are you sure the file was not corrupted during transfer?  Did you use FTP without specifying Binary mode?

     

    Sorry can you explain what you mean by setting the file to Binary mode. ?

     

     

     

  • If you zipped the file using Winzip's proprietary maximum compression, you can't even open it on a Windows computer except with Winzip.  I would check for that first.  After eliminating other likely explantions, I would look at whether the file was modified by the copy process.  This is a possibility, considering you're moving a file between different operating systems and hardware.

    You don't say how you copied the file to the Unix machine.  If it was by using FTP, there is a setting for specifying ascii or binary mode that you should be aware of.  Binary mode tries to copy the file exactly, but ascii mode MAY do things like append and end-of-file character that would not affect a text file but could trash a zip file.  For historical reasons, ascii mode is often the default.  If you didn't use FTP, this is not an issue.

    Another simple check would be to see if the file size is identical on both machines.

Viewing 8 posts - 1 through 7 (of 7 total)

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