in reply to Archive::ZIP - Zip selection of files

@files = $zip->addTree( "$zippath" );
$zip->addTree( $root, $dest [, $pred, $compressionLevel ] ) -- Add tre +e of files to a zip

Maybe you want to use the select predicate as documented in Archive::Zip? Or just leave that line out?

Also, personally, I would run the archival in the background and then send the user an email on completion instead of repeatedly trying to run a script, which can fail half-way.

Replies are listed 'Best First'.
Re^2: Archive::ZIP - Zip selection of files
by Anonymous Monk on Apr 10, 2015 at 09:21 UTC
    Thank you for your answer. By using your solution I would not be able to get the names of the files, I guess. But I need them (including the path) to delete them afterwards. I'm not happy with executing a script on and on also, but I'm using it for just ten of my users. They have stored a huge amount of pictures. That is why I'm constantly running in a script timeout.

      Why would you use Archive::Zip to get the names of the files not yet in the archive?

      Use File::Find to get the names of the files not in the archive.

        Because I would have to compare the source folders/files with those in the archive. To much code in my opinion. All I want is the script selecting - let's say - 300 files, adding them to an archive and deleting the source files from its source folders. Then execute again. Next 300 files ... and so on, up until the source folders are empty and one (now big archive) is written. I'm still wondering why the script is totally ignoring the selection of entries in the array.