in reply to Re^2: Deleting Oldest Logfiles
in thread Deleting Oldest Logfiles
1. The -1 and the 2 within square brackets inside the partition_usage sub. What is their exact purpose?
The construct before these square brackets return lists. [2] picks the third item of that list (remember, indexes are zero-based) (here: the third whitespace delimited field of the input), and [-1] returns the last list item.
2. If i had to glob for zipped logfiles within subdirectories how could i do it?
If you have fixed depth, say 2, you could write */*/*.log.gz. If not you'd have to use File::Find (or File::Find::Rule, which beginners seem to like better).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Deleting Oldest Logfiles
by longjohnsilver (Acolyte) on Oct 24, 2008 at 07:18 UTC |