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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.