Commit 84212599 authored by Christophe Massiot's avatar Christophe Massiot

* multicat_expire.sh: Shell script to manage expiration of files with the

   directory output.
parent 7aa24e77
......@@ -83,7 +83,7 @@ static void usage(void)
msg_Raw( NULL, " -k: start at the given position (in 27 MHz units, negative = from the end)" );
msg_Raw( NULL, " -d: exit after definite time (in 27 MHz units)" );
msg_Raw( NULL, " -a: append to existing destination file (risky)" );
msg_Raw( NULL, " -r: in directory mode, rotate file after this duration (default: 97200000000 ticks = 1 hour" );
msg_Raw( NULL, " -r: in directory mode, rotate file after this duration (default: 97200000000 ticks = 1 hour)" );
msg_Raw( NULL, " -S: overwrite or create RTP SSRC" );
msg_Raw( NULL, " -u: source has no RTP header" );
msg_Raw( NULL, " -U: destination has no RTP header" );
......
#!/bin/sh
###############################################################################
# multicat_expire.sh
###############################################################################
# Copyright (C) 2011 VideoLAN
# $Id: dvbiscovery.sh 178 2011-01-01 19:13:26Z massiot $
#
# Authors: Christophe Massiot <massiot@via.ecp.fr>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
###############################################################################
usage() {
echo "Usage: $0 <directory> <number of chunks>" >&2
exit 1
}
if test $# -ne 2 -o "$1" = "-h" -o "$1" = "--help"; then
usage
fi
DIR=$1
WANTED_CHUNKS=$2
NB_CHUNKS=`ls -f "$DIR/*.ts" | wc -l`
if test $NB_CHUNKS -gt $WANTED_CHUNKS; then
ls -t "$DIR/*.ts" | tail -n $(($WANTED_CHUNKS-$NB_CHUNKS)) | xargs echo
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment