View Single Post
  #2 (permalink)  
Old 07-27-2007, 03:20 AM
ragavraj ragavraj is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 92
ragavraj is on a distinguished road
Default Re: How to create Tar using perl?

Here is the script for create a tar file using perl

Quote:
#!/usr/bin/perl -w
$vDir=shift(@ARGV);
chomp($vDir);
$vDir =~ tr/\///d;
print "Archiving $vDir/* ...\n";
$vTarName=$vDir."test.tar.gz";
$vContent="tar -zpscf ".$vTarName." ".$vDir."/*";
system($vContent);
print("\n");
Thanks
R.Rajan
Reply With Quote