[Asterisk-cvs] asterisk/contrib/scripts messages-expire.pl,1.1,1.2
markster at lists.digium.com
markster at lists.digium.com
Tue Jun 22 14:18:51 CDT 2004
- Previous message: [Asterisk-cvs] asterisk/channels chan_iax2.c,1.156,1.157
- Next message: [Asterisk-cvs] asterisk/channels chan_agent.c,1.75,1.76 chan_h323.c,1.60,1.61 chan_iax.c,1.60,1.61 chan_iax2.c,1.157,1.158 chan_local.c,1.30,1.31 chan_mgcp.c,1.55,1.56 chan_modem.c,1.23,1.24 chan_nbs.c,1.7,1.8 chan_phone.c,1.29,1.30 chan_sip.c,1.421,1.422 chan_skinny.c,1.47,1.48 chan_vofr.c,1.15,1.16 chan_vpb.c,1.27,1.28
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/asterisk/contrib/scripts
In directory mongoose.digium.com:/tmp/cvs-serv21363/contrib/scripts
Modified Files:
messages-expire.pl
Log Message:
Update messages-expire script
Index: messages-expire.pl
===================================================================
RCS file: /usr/cvsroot/asterisk/contrib/scripts/messages-expire.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- messages-expire.pl 22 Oct 2003 03:58:58 -0000 1.1
+++ messages-expire.pl 22 Jun 2004 18:04:46 -0000 1.2
@@ -13,10 +13,33 @@
# Age (Delete files older than $age days old)
$age = 31;
-# Delete all files older than $age (but named msg????.??? to be sure
-# we don't delete greetings or the user's name)
+# Age for unheard messages (Defaults to same age for all messages)
+# Set to 0 to not delete unheard messages
+$unheardage = $age;
-system('find '.$dir.'/'.$context.' -name msg????.??? -mtime +'.$age.' -exec rm {} \; -exec echo Deleted {} \;');
+
+# Delete all files older than $age and $unheardage
+# (named msg????.??? to get the audio and txt files,
+# but we don't delete greetings or the user's name)
+
+if($age==$unheardage) {
+
+ # Save time by doing one find if we're treating everything the same
+ system('find '.$dir.'/'.$context.' -name msg????.??? -mtime +'.$age.' -exec rm {} \; -exec echo Deleted {} \;');
+
+} else {
+
+ # Find everything not in a folder called 'INBOX' and delete it after $age days
+ system('find '.$dir.'/'.$context.' -path \'*INBOX*\' -prune -o -name msg????.??? -mtime +'.$age.' -exec rm {} \; -exec echo Deleted {} \;');
+
+ # If unheardage is set to 0, we won't delete any unheard messages
+ if($unheardage > 0) {
+
+ # Delete things that are in a folder called INBOX after $unheardage days
+ system('find '.$dir.'/'.$context.' -path \'*INBOX*\' -name msg????.??? -mtime +'.$unheardage.' -exec rm {} \; -exec echo Deleted {} \;');
+
+ }
+}
# For testing - what number to we start when we renumber?
$start = "0";
- Previous message: [Asterisk-cvs] asterisk/channels chan_iax2.c,1.156,1.157
- Next message: [Asterisk-cvs] asterisk/channels chan_agent.c,1.75,1.76 chan_h323.c,1.60,1.61 chan_iax.c,1.60,1.61 chan_iax2.c,1.157,1.158 chan_local.c,1.30,1.31 chan_mgcp.c,1.55,1.56 chan_modem.c,1.23,1.24 chan_nbs.c,1.7,1.8 chan_phone.c,1.29,1.30 chan_sip.c,1.421,1.422 chan_skinny.c,1.47,1.48 chan_vofr.c,1.15,1.16 chan_vpb.c,1.27,1.28
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list