prerna1 has asked for the wisdom of the Perl Monks concerning the following question:

there are 2 drives on windows 2003 server A: (Mapped filesystem , low storage , tape) G: (Local drive) I want to take a backup of a folder say "Backup" ( and its subdirectories) using compressing and uncompressing this folder and without disturbing the internal folder structure, that too using perl. please help
  • Comment on Compress and uncompress directories using perl on Windows without disturbing the internal directory structure

Replies are listed 'Best First'.
Re: Compress and uncompress directories using perl on Windows without disturbing the internal directory structure
by marto (Cardinal) on Mar 14, 2012 at 18:08 UTC

    You could look at using the Archive::Zip module (see also Archive::Zip::FAQ), and it's addTree method. See (Installing Modules from the Tutorials section). If one drive is low on disk space ensure you write zip files/temp files to a drive which isn't low on space. Windows allows you to browse and extract the contents of Zip files with Windows Explorer, thought Archive::Zip can also do extraction.

      Can you please provide a short coding for the same? " I do have a coding, but its not working on Windows in shell script" tar cpf - sp |(chdir ${A}\\${B}\\Base; tar xpf -)

        The second link I provided has working code.