/* DAILYZIP.CMD Pack up files in a zip archive with a name that gives today's date, e.g. 1998_08_14.zip on HPFS or 19980814.zip on FAT */ /* Get the name of the file with the list of files to archive */ Parse Arg SourceFile If SourceFile="" then Do Say Say "You must enter the name of the file with the archive list." Say Exit end /* do */ /* Set up our date strings */ DateString = Date("S") Year = SubStr(DateString,1,4) Month = SubStr(DateString,5,2) Day = SubStr(DateString,7,2) /* Create a name for the zip file, FAT-compatible if necessary */ FileName = Year||"_"||Month||"_"||Day||".zip" rc = Stream(FileName,"C", "Open") /* Can we create this file? */ rc2 = Stream(FileName,"C","Close") /* Close the file */ /* Register REXXLIB functions and then delete the file */ call rxfuncadd 'SysLoadFuncs','RexxUtil','SysLoadFuncs' call sysloadfuncs rc2 = SysFileDelete(FileName) /* Delete it so we don't mess up Info-Zip */ If Pos("READY",rc)=0 then FileName = DateString||".zip" /* Now read our archive list and make the zip file */ Do While Lines(SourceFile) Source = Linein(SourceFile) "zip -r" FileName Source /* Execute Info-Zip, -r makes it recursive through sub-dirs. */ End rc=Stream(SourceFile,"C","Close")