dect
/
asterisk
Archived
13
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
russell 6c9005cf19 Merged revisions 83316 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83316 | russell | 2007-09-20 16:01:20 -0500 (Thu, 20 Sep 2007) | 3 lines

Change safe_asterisk to explicitly ask for /bin/bash, as it uses bashisms.
(closes issue #10772, reported by culrich)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83317 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-20 21:02:17 +00:00
..
README.messages-expire
agents.php
ast_grab_core Merged revisions 77844 via svnmerge from 2007-07-31 21:33:37 +00:00
astgenkey
astgenkey.8 oops - somebody forgot to change this - long ago, probably. 2006-10-26 18:04:46 +00:00
autosupport
autosupport.8
iax-friends.sql
loadtest.tcl
lookup.agi
managerproxy.pl
meetme.sql
messages-expire.pl
postgres_cdr.sql
qview.pl
realtime_pgsql.sql Merged revisions 63403 via svnmerge from 2007-05-08 15:11:31 +00:00
retrieve_extensions_from_mysql.pl
retrieve_extensions_from_sql.pl
retrieve_sip_conf_from_mysql.pl
safe_asterisk Merged revisions 83316 via svnmerge from 2007-09-20 21:02:17 +00:00
safe_asterisk.8
safe_asterisk_restart
sip-friends.sql
vmail.cgi Merged revisions 81189 via svnmerge from 2007-08-28 14:12:55 +00:00
vmdb.sql Merged revisions 51236 via svnmerge from 2007-01-18 17:52:56 +00:00

README.messages-expire

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.