zZipFiles with File List
Keywords: delimited file list
Question:
I am trying to write a simple script to backup certain directories (incl subdirs) from a local drive to a .zip file on a server. However, I can't seem to find the right syntax.I want to backup the entire contents of the following diretories:
C:\My Documents C:\Progra~1\Netscape\Users\*\mail C:\Progra~1\Netscape\Users\*\archive C:\Progra~1\Netscape\Users\*\newsincluding subdirs, to a zipfile on a server. The syntax I'm using is:ret=zZipFiles("R",archive,"C:\My Documents\*.*") dirlist=diritemize("C:\Program Files\Netscape\Users\*") for i=1 to itemcount(dirlist,@TAB) dir=itemextract(i,dirlist,@TAB) dirchange("c:\program files\netscape\users\%dir%") ret=zZipFiles("g R",archive,"*.* mail\*.* archive\*.* news\*.*") nextWhat am I doing wrong?Answer:
A couple of things:
- zZipFiles has a 4th parameter (exclude files). In your case, specify ""
- Add a dirchange to where you want the archive file created, and specify archive file. Archive file must be successfully created for the next zZipFiles with "g" option to succeed.
- Put "|" delimiters in file lists. See below:
AddExtender("WWZIP34I.DLL") DirChange("C:\My Documents") archive="C:\My Documents\archive.zip" ret=zZipFiles("R",archive,"C:\My Documents\*.*","") message("",ret) dirlist=diritemize("C:\Program Files\Netscape\Users\*") message("",dirlist) for i=1 to itemcount(dirlist,@TAB) dir=itemextract(i,dirlist,@TAB) dirchange("c:\program files\netscape\users\%dir%") ret=zZipFiles("g R",archive,"*.*|mail\*.*|archive\*.*|news\*.*","") message("",ret) next
Article ID: W14111Filename: zZipFiles with File List.txt