Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
asterisk/contrib/scripts
markster ad916c0c92 Add John's autosupport script
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4858 f38db490-d61c-443f-a65b-d21fe96a405b
2005-01-21 03:43:03 +00:00
..
addmailbox
agents.php Merge manager action and example (bug #2701) 2004-12-01 05:00:29 +00:00
astgenkey Update astgenkey to make empty ones too 2004-09-15 04:19:58 +00:00
astxs update astxs (small tweak) 2004-12-22 18:26:10 +00:00
autosupport Add John's autosupport script 2005-01-21 03:43:03 +00:00
iax-friends.sql
managerproxy.pl Fix managerproxy (bug #2506) 2004-11-02 22:34:51 +00:00
messages-expire.pl Update messages-expire script 2004-06-22 18:04:46 +00:00
postgres_cdr.sql
qview.pl
README.messages-expire Trivial fix for README.messages-expire 2004-07-07 21:02:07 +00:00
retrieve_extensions_from_mysql.pl
retrieve_extensions_from_sql.pl
retrieve_sip_conf_from_mysql.pl
safe_asterisk Specify hostname if there is a crash (bug #2958) 2004-12-01 05:10:32 +00:00
sip-friends.sql
vmail.cgi vmail.cgi updates (bug #2686) 2004-11-01 02:08:55 +00:00
vmdb.sql

messages-expire.pl

messages-expire finds messages more than X days old and deletes them. 
Because the older messages will be the lower numbers in the folder (msg0000
will be older than msg0005), just deleting msg0000 will not work. 
expire-messages then runs a routine that goes into every folder in every
mailbox to reorganize.  If the folder contains msg0000, no action is taken. 
If the folder does not, the rename routine takes the oldest message and
names it msg0000, the next oldest message and names it msg0001 and so on.

The file deletion is done by the -exec parameter to 'find'.  It would be far
more efficient to take the output from 'find' and just reorganize the
directories from which we deleted a file.  Something for the future...

Keep in mind that messages are deleted at the beginning of the script you
will have mailbox trouble if you check messages before the script
reorganizes your mailbox.

To use it, make sure the paths are right.  Adjust $age (originally set to
31) if necessary.