I'm confused about what you're trying to do.
Option 1:
Why not just zip the entire directory? The zip process doesn't care if there were 10 files yesterday, and 10 new ones that it added today.
Option 2:
Create a batch file that deletes yesterday's zip file, then creates a new one for today.
Option 3:
Create a batch file that archives the *.wek files one at a time. If the archived file already exists, don't do anything to that file.
Code for Option 3:
:: This file will backup *.wek files into *.wek.zip
:: i.e., abc.wek gets zipped into abc.wek.zip
:: If the matching zip file already exists, the original file does not get backed up.
:: i.e., if cde.wek.zip already exists, then cde.wek does not get backed up
:: IMPORTANT:
:: change \path\to\files (below) to the correct path to your files that need to be backed up
:: change \path\to\archives (below, twice) to the correct location of your backup folder
:: change c:\tools\7zip\7za.exe (below) to the correct path to the 7-zip command-line tool
::
:: make sure we're on the C drive
C:
:: change to our data directory
cd \path\to\files
:: create the backups
for %%k in (*.wek) do if not exist "c:\path\to\archives\%%k.zip" c:\tools\7zip\7za.exe a "c:\path\to\archives\%%k.zip" "%%k"
do you want to put these 10 new files to a new archive or do you want to update an existing archive so at the end of the operation the existing archive contains 10 new files PLUS the old content? – akira – 2010-08-02T08:13:20.667
@akira, i want to put new files in archive and delete previous set. ie. delete file.7z, add only new files – eugeneK – 2010-08-02T08:24:38.013