asterisk/contrib/scripts
Alexander Zhirov 9bcf1461bb v18.15.1 2023-05-25 21:45:57 +03:00
..
sip_to_pjsip v18.15.1 2023-05-25 21:45:57 +03:00
README.messages-expire v18.15.1 2023-05-25 21:45:57 +03:00
agents.php v18.15.1 2023-05-25 21:45:57 +03:00
ast_coredumper v18.15.1 2023-05-25 21:45:57 +03:00
ast_grab_core v18.15.1 2023-05-25 21:45:57 +03:00
ast_logescalator v18.15.1 2023-05-25 21:45:57 +03:00
ast_loggrabber v18.15.1 2023-05-25 21:45:57 +03:00
ast_tls_cert v18.15.1 2023-05-25 21:45:57 +03:00
astcli v18.15.1 2023-05-25 21:45:57 +03:00
asterisk.ldap-schema v18.15.1 2023-05-25 21:45:57 +03:00
asterisk.ldif v18.15.1 2023-05-25 21:45:57 +03:00
asterisk.logrotate v18.15.1 2023-05-25 21:45:57 +03:00
astgenkey v18.15.1 2023-05-25 21:45:57 +03:00
astgenkey.8 v18.15.1 2023-05-25 21:45:57 +03:00
astversion v18.15.1 2023-05-25 21:45:57 +03:00
autosupport v18.15.1 2023-05-25 21:45:57 +03:00
autosupport.8 v18.15.1 2023-05-25 21:45:57 +03:00
clang-scan-build v18.15.1 2023-05-25 21:45:57 +03:00
dahdi_span_config_hook v18.15.1 2023-05-25 21:45:57 +03:00
dbsep.cgi v18.15.1 2023-05-25 21:45:57 +03:00
file.convert.sh v18.15.1 2023-05-25 21:45:57 +03:00
get_ilbc_source.sh v18.15.1 2023-05-25 21:45:57 +03:00
get_mp3_source.sh v18.15.1 2023-05-25 21:45:57 +03:00
get_swagger_ui.sh v18.15.1 2023-05-25 21:45:57 +03:00
import-cdr-csv-mysql.pl v18.15.1 2023-05-25 21:45:57 +03:00
install_prereq v18.15.1 2023-05-25 21:45:57 +03:00
live_ast v18.15.1 2023-05-25 21:45:57 +03:00
loadtest.tcl v18.15.1 2023-05-25 21:45:57 +03:00
lookup.agi v18.15.1 2023-05-25 21:45:57 +03:00
managerproxy.pl v18.15.1 2023-05-25 21:45:57 +03:00
messages-expire.pl v18.15.1 2023-05-25 21:45:57 +03:00
qview.pl v18.15.1 2023-05-25 21:45:57 +03:00
refcounter.py v18.15.1 2023-05-25 21:45:57 +03:00
reflocks.py v18.15.1 2023-05-25 21:45:57 +03:00
refstats.py v18.15.1 2023-05-25 21:45:57 +03:00
retrieve_extensions_from_mysql.pl v18.15.1 2023-05-25 21:45:57 +03:00
retrieve_extensions_from_sql.pl v18.15.1 2023-05-25 21:45:57 +03:00
retrieve_sip_conf_from_mysql.pl v18.15.1 2023-05-25 21:45:57 +03:00
safe_asterisk v18.15.1 2023-05-25 21:45:57 +03:00
safe_asterisk.8 v18.15.1 2023-05-25 21:45:57 +03:00
safe_asterisk_restart v18.15.1 2023-05-25 21:45:57 +03:00
sip_nat_settings v18.15.1 2023-05-25 21:45:57 +03:00
sipp-sendfax.xml v18.15.1 2023-05-25 21:45:57 +03:00
spandspflow2pcap.log v18.15.1 2023-05-25 21:45:57 +03:00
spandspflow2pcap.py v18.15.1 2023-05-25 21:45:57 +03:00
valgrind_compare v18.15.1 2023-05-25 21:45:57 +03:00
vmail.cgi v18.15.1 2023-05-25 21:45:57 +03:00
voicemailpwcheck.py v18.15.1 2023-05-25 21:45:57 +03: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.