atiisler
(Fresh Scripter)
2002-07-22 08:20 PM
zipping files

Hi everyone.

Does anyone know if its possible to create a script using kixtart that will zip 4 files creating a zip package that can be then copied?


Les
(KiX Master)
2002-07-22 08:36 PM
Re: zipping files

If you were to search the "Scripts" forum for the word "ZIP" in the subject line, you would get more than enough hits to know that it can be done.

atiisler
(Fresh Scripter)
2002-07-22 09:03 PM
Re: zipping files

Thanks...but I really didn't find what I want to do...
Let me explain a little better..

I am using a kixtart script that is copy files from a client machine to server drive. This works great for most users. The problem comes with some remote users who have to use dial-up. The script still works but the file copy is SLOWWWWWW. So I thought if I could zip these files then copy over then unzip at the remote users machine, it wouldn't take so long.
Is this possible? I would have to initiate the zip program somehow and zip these selected files. I don't intend to zip the kix program.
Thanks again


Radimus
(KiX Supporter)
2002-07-22 09:33 PM
Re: zipping files

this isn't a begginner's answer, but what you want to do is in this thread: http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=13;t=000122

atiisler
(Fresh Scripter)
2002-07-22 09:40 PM
Re: zipping files

Radimus
Are you directing me here because PKzip is not Scriptable...that I can not use it with Kixtart.

Do you know what "wzzip" is ?


Kdyer
(KiX Supporter)
2002-07-22 09:44 PM
Re: zipping files

atiisler,

wzzip is the COMMAND-LINE version of WinZIP..

Kent


Radimus
(KiX Supporter)
2002-07-22 09:45 PM
Re: zipping files

pkzip... the DOS version is as scriptable as commandline application is.

so you have a directory of files that you want to zip individually and then copy/move to a network location on a RAS connection?

post the command switched for pkzip and I'll see what I can come up with...


atiisler
(Fresh Scripter)
2002-07-22 09:51 PM
Re: zipping files

Actually I have a directory of files, but I only want to zip some of the files. I have 5 files out of a directory I want to zip. I do not want to zip each file individually (unless thats the only way) I want to create one zipped file that is including the 5 files.

I am not sure what you meant in your last line...I


Radimus
(KiX Supporter)
2002-07-22 10:04 PM
Re: zipping files

this is untested, and the command will not work, but should give you the idea. requires the makepath() UDF

code:
break on
call \\a06\logon\udf.kix

$zipcmd ="?"
$source ="c:\drivers\chipset"
$temp ="c:\ziptemp"
$dest ="$desktop\zip"

if exist($source)
if not exist("$temp") makepath("$temp") endif
$d=dir($source)
while not @error
shell'%comspec% /c $zipcmd "$source\$d" "$temp\$d.zip"
$d=dir()
loop
if not exist("$dest") makepath("$dest") endif
copy "$temp\*.zip" "$dest"
if not @error del "$temp\*.zip" endif
endif



Les
(KiX Master)
2002-07-22 10:12 PM
Re: zipping files

atiisler,
Have you thought this through? Is the ZIpping and unZIPping do be done from within the same script session?

start script... zip files... send files... unzip... end script

Unless you setup some sort of client / server script pair with handshaking, you're not really saving any bandwidth. Whatever you do on the server from the client will have to go over the RAS pipe twice because it's done in the client's memory.


atiisler
(Fresh Scripter)
2002-07-22 10:23 PM
Re: zipping files

So do you think I would be better to zip the files on the server side and then just copy that zipped file to the client and let the client unzip it at that point?

Also Radimus...
In your code what does "$zipcmd = "?"" do...I don't really understand.

What I think your saying is copy my selected files to a temp folder and then zip the tempfolder and copy this to my destination folder.Am I correct...

I must confess, I have just started workin with Kixtart....
Thanks...


Kdyer
(KiX Supporter)
2002-07-23 06:23 AM
Re: zipping files

Of course you can use PKZIP.EXE or PKUNZIP.EXE. As an FYI, if you go to - http://www.winzip.com/wzcline.htm

And download the command-line add-on - http://www.winzip.com/getsite.cgi?wzcline.exe

If we look at one of our batch jobs, we see:
code:
"c:\program files\winzip\wzzip" -u -p -r -xtranslog.* d:\tables.zip d:\backup\tables\*.*

:: wzzip [options] zipfile [@listfile] [files...]
:: -f freshen
:: -u update
:: -p store folder names
:: -r recurse folders
:: -x exclude file(s)

Have fun!

Kent

[ 23 July 2002, 06:23: Message edited by: kdyer ]


Sealeopard
(KiX Master)
2002-07-23 03:49 PM
Re: zipping files

atiisler:

Can you enlighten us as to what exactly you are trying to accomplish. As far as I understand your problem, you're ZIPping some file on a server, copy them to a client, then UNZIPing them on the client side within the same script?

If you do this to save bandwidth, then this approach will definitely not result in less but more bandwidth usage.


Les
(KiX Master)
2002-07-23 04:24 PM
Re: zipping files

Jens,
I'm as confused as you. In his second post he said it was from client to server but in the fifth, it's from server to client.

No mention of whether it's a logon or other script. I sat on my hands for fifteen minutes... should have held out longer...


atiisler
(Fresh Scripter)
2002-07-23 04:28 PM
Re: zipping files

I think I have come to that conclusion myself too. Just copying the zipped file without any script or unzipping was still a 10 minute process add on the overhead and I'm sure its going to be about 15 which is the same time as the script that copies the files to the network....

Thanks for all your help.....


Sealeopard
(KiX Master)
2002-07-23 04:29 PM
Re: zipping files

The thing is I don't even understand what he's trying to accomplishg by transferring a ZIP file. It doesn't seem to be for archiving purposes, though.

So, I would really like to get a clarification as to what the big picture is in this case.


atiisler
(Fresh Scripter)
2002-07-23 04:41 PM
Re: zipping files

Just for clarification sake....
It is not a logon script but a batch file sitting behind an icon on desktop. Also it is the process of copying files on the users local machine to a network directory on a file server for backup purposes. The user is dial up only and I thought the zipping of the files might be a quicker transmission. But as pointed out the overhead of first locating files (script) - then zipping - then unzippingon the server (more script) does not appear to be any quicker or save and bandwidth at all....
Does anyone have any suggestions for a faster delivery? Sorry for any confusion.


Les
(KiX Master)
2002-07-23 04:46 PM
Re: zipping files

Another thing to factor is compression over RAS. Modems will automatically compress the data stream so pre-compressing the data negates that.

If the data were pre-compressed on the far side(where the data is) and uncompressed locally, a small improvement may be realized, but if the compressing/decompressing is done on the same side, the bandwidth will increase rather than decrease.


Sealeopard
(KiX Master)
2002-07-23 04:56 PM
Re: zipping files

Couldn't have said it better. Just copy the raw files with no compression at all.

Also, if the script on the user's desktop will decompress the script ont he fileserver, then your bandwidth usage will go though the roof. The reaosn is that the ZIP file will be transmitted back tot he user's desktop for the decompression in local memory and then the unZIPed files will be transmitted back to the fileserver. Therefore, the user's script should not do anything on the remote fileserver like decompressing.