Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Archive::Tar- how do I tar a whole directory tree

by Masem (Monsignor)
on Jan 08, 2002 at 19:21 UTC ( [id://137149]=note: print w/replies, xml ) Need Help??


in reply to Archive::Tar- how do I tar a whole directory tree

The last argument of create_archive is a list. You can generate a list of files that would be in a directory using glob. So you can call this as :
Archive::Tar->create_archive( "my.tar.gz", 9, glob "/this/*", glob "/t +hat/*" );

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

Replies are listed 'Best First'.
Re: Archive::Tar - how do you tar a directory tree?
by foogod (Friar) on Jan 08, 2002 at 20:20 UTC

    TIMTOWTDI

    A simple way is the command line code:

    #!/usr/bin/perl use strict; my $destination = "Archive_filename_to_be_created"; my $source = "/home/users/billyjo/stuff_to_backup/"; my $cmd = `tar -cpf $destination $source`; ####### The line above uses the backtick operation, not single quotes! + ##########

    As far as using the Archive::Tar module, (RTFM) :-)

    - f o o g o d

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://137149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found