Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Is this the most elegant way to code directory lookup?

by Anonymous Monk
on Sep 29, 2006 at 15:31 UTC ( [id://575554]=note: print w/replies, xml ) Need Help??


in reply to Is this the most elegant way to code directory lookup?

If I understand this correctly, the program takes every file in /var/local/some_dir/ that isn't older than a day, and tars it up in /backup/some_dir/, right? I'm not sure I understand the reason to tar up each file into a different archive, but I wouldn't do it in Perl, but I'd use the shell instead. Perhaps (untested):
cd /var/local/some_dir find . -type -f -mtime 1 -maxdepth 1 \ -exec tar cfz /backup/some_dir/{}.tar.gz {} \;
But I guess I'd backup all the files in a single archive; then I'd use find (as above) to list the files, and pipe that into cpio to create the archive.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-20 00:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found