purpose remove old account directories to save space.
Initial State
Here is a what test.txt contains (mbox,userid only) the file is about 2gb contains about 10+ million lines.
Expected results.
read test.txt into script line by line
check each directory volume on server looking for mailbox (mail boxes are hashed in reverse if you had a id that had a mailbox # 123456789 the following should be found in a directory like /home/folder/volume#/98/76/123456789 there are multiple volumes.
once the mailbox is found build a path to mailbox for later removal
if mbox is found move mailbox directory from /home/folder/volume#/98/76/123456789 to /home/folder/volume#/98/76/123456789-trash (for later deletion by another script if space saving is worth it)
write the actions to a file called mbox_stats.txt with the following information
id,full mailbox path ( for example /home/folder/volume#/98/76/123456789),directory size
add up each directory found in mbox_stat to determine total savings if removed
In reply to Re^2: Increase script speed
by ctrevgo_learn_perl
in thread Increase script speed
by ctrevgo_learn_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |