2012-03-05 08:18:35 +08:00
|
|
|
#!/bin/bash
|
2011-08-26 06:47:03 +08:00
|
|
|
#
|
2013-01-27 22:44:40 +08:00
|
|
|
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
2011-08-26 06:47:03 +08:00
|
|
|
#
|
2013-01-27 22:44:40 +08:00
|
|
|
# Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
|
2011-08-26 06:47:03 +08:00
|
|
|
#
|
2013-01-27 22:44:40 +08:00
|
|
|
# This program is free software; you can redistribute it and/or modify it under the
|
2011-08-26 06:47:03 +08:00
|
|
|
# terms of the GNU Lesser General Public License as published by the Free Software
|
2013-01-27 22:44:40 +08:00
|
|
|
# Foundation; either version 3.0 of the License, or (at your option) any later
|
2011-08-26 06:47:03 +08:00
|
|
|
# version.
|
|
|
|
#
|
|
|
|
# BigBlueButton 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 Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# Author(s):
|
|
|
|
# Fred Dixon <ffdixon@bigbluebutton.org>
|
2013-01-27 22:44:40 +08:00
|
|
|
# Gustavo Salazar <guga.salazar.loor@gmail.com>
|
2016-09-27 18:46:38 +08:00
|
|
|
# Ghazi Triki <ghazi.nocturne@gmail.com>
|
2022-01-07 21:23:06 +08:00
|
|
|
# Daniel Petri Rocha <danielpetrirocha@gmail.com>
|
2011-08-26 06:47:03 +08:00
|
|
|
#
|
|
|
|
# Changelog:
|
|
|
|
# 2011-08-18 FFD Inital Version
|
2011-11-20 22:33:55 +08:00
|
|
|
# 2011-11-20 FFD Added more checks for processing of recording
|
2012-01-06 06:07:34 +08:00
|
|
|
# 2012-01-04 GUG Add option to check for errors
|
2012-02-28 00:40:35 +08:00
|
|
|
# 2012-02-27 GUG Add option to delete one meeting and recording
|
2012-08-14 05:25:57 +08:00
|
|
|
# 2012-08-13 GUG Republish recording
|
2012-10-23 05:13:16 +08:00
|
|
|
# 2012-10-22 FFD Use combination of /var/bigbluebutton and /var/bigbluebutton/recording/raw
|
|
|
|
# to get the list of recent recordings for bbb-record --watch
|
2013-04-06 06:37:05 +08:00
|
|
|
# 2013-04-03 GUG Enable/Disable a recording workflow
|
|
|
|
# 2013-04-05 GUG Description is optional in bbb-record --watch
|
|
|
|
# 2013-04-05 GUG Map internal meeting id with external meeting id
|
2017-03-29 01:30:07 +08:00
|
|
|
# 2016-07-02 FFD Updates for 1.1-beta
|
2016-10-17 16:08:29 +08:00
|
|
|
# 2016-10-17 GTR Stricter rule for detection of recording directories names
|
2017-03-29 01:30:07 +08:00
|
|
|
# 2017-04-28 FFD Updated references to systemd processing units
|
2019-05-14 04:59:08 +08:00
|
|
|
# 2019-05-13 GTR Delete caption files
|
2019-08-30 22:37:18 +08:00
|
|
|
# 2019-08-30 GTR Count SVG slides fallaback
|
2020-10-22 21:30:51 +08:00
|
|
|
# 2020-10-22 AGG Remove traces of red5 apps
|
2022-01-21 01:40:12 +08:00
|
|
|
# 2022-01-07 DPR Refactoring with shellcheck; more checks for recording configuration;
|
|
|
|
# option to list workflows
|
2019-08-30 22:37:18 +08:00
|
|
|
|
2011-08-26 06:47:03 +08:00
|
|
|
|
2012-08-22 08:43:31 +08:00
|
|
|
#set -e
|
2011-08-26 06:47:03 +08:00
|
|
|
#set -x
|
|
|
|
|
2024-02-08 19:54:11 +08:00
|
|
|
unset HEADER WATCH WITHDESC LIST LISTWORKFLOWS LIST WITHDESC REBUILD REBUILDALL \
|
|
|
|
REPUBLISH DELETE DELETEALL CHECK DEBUG CLEAN DISABLE ENABLE TOEXTERNAL TOINTERNAL
|
|
|
|
|
2012-02-28 23:06:29 +08:00
|
|
|
source /etc/bigbluebutton/bigbluebutton-release
|
2011-08-26 06:47:03 +08:00
|
|
|
|
2022-01-12 00:20:45 +08:00
|
|
|
declare -r BBB_USER=bigbluebutton
|
|
|
|
declare -r BBB_YML=/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml
|
2022-01-08 21:58:47 +08:00
|
|
|
|
|
|
|
# $1: Desired property
|
|
|
|
# Only returns 'PRODUCTION' values
|
|
|
|
get_yml_value(){
|
2022-01-21 01:40:12 +08:00
|
|
|
yq read "$BBB_YML" "$1" --prettyPrint
|
2022-01-08 21:58:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
PLAYBACK_PROTOCOL=$(get_yml_value playback_protocol)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly PLAYBACK_PROTOCOL
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
RECORDING_DIR=$(get_yml_value recording_dir)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly RECORDING_DIR
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
LOG_DIR=$(get_yml_value log_dir)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly LOG_DIR
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
PUBLISHED_DIR=$(get_yml_value published_dir)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly PUBLISHED_DIR
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
RAW_AUDIO_SRC=$(get_yml_value raw_audio_src)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly RAW_AUDIO_SRC
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
RAW_VIDEO_SRC=$(get_yml_value raw_video_src)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly RAW_VIDEO_SRC
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
RAW_SCREENSHARE_SRC=$(get_yml_value raw_screenshare_src)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly RAW_SCREENSHARE_SRC
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
RAW_PRESENTATION_SRC=$(get_yml_value raw_presentation_src)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly RAW_PRESENTATION_SRC
|
2022-01-08 21:58:47 +08:00
|
|
|
|
2022-01-12 00:20:45 +08:00
|
|
|
declare -r BASE=$RAW_PRESENTATION_SRC/recording
|
|
|
|
declare -r STATUS=$BASE/status
|
2011-11-20 22:33:55 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
TYPES=$(cd /usr/local/bigbluebutton/core/scripts/process || exit; find -- *.rb | sed s/.rb//g)
|
2022-01-12 00:20:45 +08:00
|
|
|
readonly TYPES
|
|
|
|
|
|
|
|
declare -r MEETING_PATTERN="^[0-9a-f]\{40\}-[[:digit:]]\{13\}$"
|
2011-08-31 04:12:37 +08:00
|
|
|
|
|
|
|
mark_for_rebuild() {
|
2020-11-17 06:32:39 +08:00
|
|
|
MEETING_ID=$1
|
|
|
|
echo "Marking for rebuild $MEETING_ID"
|
|
|
|
if [[ ! -d $BASE/raw/$MEETING_ID ]]; then
|
|
|
|
echo "Raw files for $MEETING_ID do not exist, can't rebuild"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Clear out the relevant done files
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -vf "$STATUS"/archived/"$MEETING_ID".norecord
|
|
|
|
rm -vf "$STATUS"/sanity/"$MEETING_ID"*
|
|
|
|
rm -vf "$STATUS"/processed/"$MEETING_ID"*
|
|
|
|
rm -vf "$STATUS"/published/"$MEETING_ID"*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
|
|
|
# Remove the existing 'published' recording files
|
|
|
|
for type in $TYPES; do
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${PUBLISHED_DIR:?}"/"$type"/"$MEETING_ID"
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/unpublished/"$type"/"$MEETING_ID"
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/deleted/"$type"/"$MEETING_ID"
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
|
|
|
|
2021-04-29 04:11:10 +08:00
|
|
|
# Restart processing at the 'sanity' step
|
|
|
|
/usr/local/bigbluebutton/core/scripts/rap-enqueue.rb sanity "$MEETING_ID"
|
2011-08-31 04:12:37 +08:00
|
|
|
}
|
|
|
|
|
2020-11-17 06:32:39 +08:00
|
|
|
mark_for_republish() {
|
|
|
|
MEETING_ID=$1
|
|
|
|
echo "Marking for republish $MEETING_ID"
|
2015-03-11 23:16:17 +08:00
|
|
|
|
2020-11-17 06:32:39 +08:00
|
|
|
for type in $TYPES; do
|
|
|
|
if [[ ! -d $BASE/process/$type/$MEETING_ID ]]; then
|
|
|
|
echo "Processed files for $MEETING_ID ($type) do not exist, can't republish"
|
|
|
|
echo "Try rebuilding the recording instead."
|
|
|
|
continue
|
|
|
|
fi
|
2017-07-15 04:38:32 +08:00
|
|
|
|
2020-11-17 06:32:39 +08:00
|
|
|
# Clear out the publish done files
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -vf "$STATUS"/published/"$MEETING_ID"*
|
2017-07-15 04:38:32 +08:00
|
|
|
|
2020-11-17 06:32:39 +08:00
|
|
|
# Remove the existing 'published' recording files
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${PUBLISHED_DIR:?}"/"$type"/"$MEETING_ID"
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/unpublished/"$type"/"$MEETING_ID"
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/deleted/"$type"/"$MEETING_ID"
|
2015-03-11 23:16:17 +08:00
|
|
|
|
2020-11-17 06:32:39 +08:00
|
|
|
# Restart processing at the 'publish' step
|
2021-04-29 04:11:10 +08:00
|
|
|
/usr/local/bigbluebutton/core/scripts/rap-enqueue.rb "publish:$type" "$MEETING_ID"
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
2012-08-14 05:25:57 +08:00
|
|
|
}
|
|
|
|
|
2011-08-26 06:47:03 +08:00
|
|
|
need_root() {
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ $EUID != 0 ]; then
|
|
|
|
echo "Need to be root to run this option"
|
|
|
|
exit 1
|
|
|
|
fi
|
2011-08-26 06:47:03 +08:00
|
|
|
}
|
|
|
|
|
2020-11-17 06:58:47 +08:00
|
|
|
need_root_or_bigbluebutton() {
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ $EUID != 0 ] && [ "$USER" != $BBB_USER ]; then
|
2020-11-17 06:58:47 +08:00
|
|
|
echo "Need to be user root or bigbluebutton to run this option"
|
|
|
|
exit 1
|
|
|
|
fi
|
2011-08-26 06:47:03 +08:00
|
|
|
}
|
|
|
|
|
2012-02-27 04:00:37 +08:00
|
|
|
print_header() {
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ ! "$HEADER" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo
|
|
|
|
echo "** Potential problems described below **"
|
|
|
|
HEADER=1
|
|
|
|
fi
|
2012-02-27 04:00:37 +08:00
|
|
|
}
|
|
|
|
|
2022-01-07 04:47:04 +08:00
|
|
|
# Checks if the passed file/directory exists, and if they are owned by BBB's user
|
|
|
|
# $1: Path to directory or file
|
|
|
|
# $2: -d or -f
|
|
|
|
# $3: -R flag for chown
|
|
|
|
check_path_owner_group() {
|
2022-01-10 20:44:50 +08:00
|
|
|
if test "$2" "$1"; then
|
|
|
|
if [ "$(stat -c "%U:%G" "$1")" != "$BBB_USER:$BBB_USER" ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
echo "#"
|
|
|
|
echo "# Warning: owner:group of $1 not $BBB_USER:$BBB_USER."
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$3" ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
echo "# chown -R $BBB_USER:$BBB_USER $1"
|
|
|
|
else
|
|
|
|
echo "# chown $BBB_USER:$BBB_USER $1"
|
|
|
|
fi
|
|
|
|
echo "#"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "#"
|
|
|
|
echo "# Warning: $1 is missing."
|
|
|
|
echo "#"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2011-08-26 06:47:03 +08:00
|
|
|
usage() {
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "BigBlueButton Recording Diagnostic Utility (BigBlueButton Version $BIGBLUEBUTTON_RELEASE)"
|
|
|
|
echo
|
|
|
|
echo " bbb-record [options]"
|
|
|
|
echo
|
|
|
|
echo "Reporting:"
|
|
|
|
echo " --list List all recordings"
|
2022-01-07 21:23:06 +08:00
|
|
|
echo " --list-recent List recent recordings"
|
|
|
|
echo " --list-recent --withDesc List recent recordings and show their description"
|
|
|
|
echo " --list-workflows List available recording workflows"
|
2020-11-17 06:32:39 +08:00
|
|
|
echo
|
|
|
|
echo "Monitoring:"
|
|
|
|
echo " --watch Watch processing of recordings"
|
|
|
|
echo " --watch --withDesc Watch processing of recordings and show their description"
|
|
|
|
echo
|
|
|
|
echo "Administration:"
|
|
|
|
echo " --rebuild <internal meetingID> rebuild the output for the given internal meetingID"
|
|
|
|
echo " --rebuildall rebuild every recording"
|
|
|
|
echo " --delete <internal meetingID> delete one meeting and recording"
|
|
|
|
echo " --deleteall delete all meetings and recordings"
|
|
|
|
echo " --debug check for recording errors"
|
|
|
|
echo " --check check for configuration errors"
|
|
|
|
echo " --enable <workflow> enable a recording workflow"
|
|
|
|
echo " --disable <workflow> disable a recording workflow"
|
|
|
|
echo " --tointernal <external meetingId> get the internal meeting ids for the given external meetingId"
|
|
|
|
echo " --toexternal <internal meetingId> get the external meeting id for the given internal meetingId"
|
|
|
|
echo " --republish <internal meetingID> republish the recording for meetingID. (Only for Matterhorn Integration)"
|
|
|
|
#echo " --rearchive [meetingId] rearchive the recording (created before a restart)"
|
|
|
|
echo
|
2011-08-26 06:47:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
usage
|
|
|
|
exit 1
|
2011-08-26 06:47:03 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Parse the parameters
|
|
|
|
while [ $# -gt 0 ]; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-watch" ] || [ "$1" = "--watch" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
WATCH=1
|
|
|
|
if [ "$2" = "--withDesc" ]; then
|
|
|
|
WITHDESC=1
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-list" ] || [ "$1" = "--list" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
LIST=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-list-workflows" ] || [ "$1" = "--list-workflows" ]; then
|
2022-01-07 21:23:06 +08:00
|
|
|
LISTWORKFLOWS=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ "$1" = "--list-recent" ]; then
|
|
|
|
LIST=1
|
|
|
|
HEAD=10
|
|
|
|
if [ "$2" ]; then
|
|
|
|
WITHDESC=1
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-rebuild" ] || [ "$1" = "--rebuild" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
MEETING_ID="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
REBUILD=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-rebuildall" ] || [ "$1" = "--rebuildall" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
MEETING_ID="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
REBUILDALL=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-republish" ] || [ "$1" = "--republish" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
MEETING_ID="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
REPUBLISH=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-delete" ] || [ "$1" = "--delete" ]; then
|
2020-11-24 23:13:09 +08:00
|
|
|
need_root_or_bigbluebutton
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
MEETING_ID="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
DELETE=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-deleteall" ] || [ "$1" = "--deleteall" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
DELETEALL=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-check" ] || [ "$1" = "--check" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
CHECK=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-debug" ] || [ "$1" = "--debug" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
DEBUG=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-clean" ] || [ "$1" = "--clean" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
CLEAN=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-disable" ] || [ "$1" = "--disable" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
WORKFLOW="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
DISABLE=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-enable" ] || [ "$1" = "--enable" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
WORKFLOW="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
ENABLE=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-toexternal" ] || [ "$1" = "--toexternal" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
INTERNAL_MEETINGID="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
TOEXTERNAL=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$1" = "-tointernal" ] || [ "$1" = "--tointernal" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
need_root
|
|
|
|
if [ ! -z "${2}" ]; then
|
|
|
|
EXTERNAL_MEETINGID="${2}"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
TOINTERNAL=1
|
|
|
|
shift
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
usage
|
|
|
|
exit 1
|
2011-08-26 06:47:03 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ $REBUILD ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ -z "$MEETING_ID" ]; then
|
|
|
|
echo "Pass an internal meeting id as parameter."
|
|
|
|
else
|
2022-01-10 20:44:50 +08:00
|
|
|
mark_for_rebuild "$MEETING_ID"
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
|
|
|
fi
|
2012-08-14 05:25:57 +08:00
|
|
|
|
2013-09-24 06:36:53 +08:00
|
|
|
if [ $REBUILDALL ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Rebuilding all recordings"
|
2022-01-10 20:44:50 +08:00
|
|
|
for recording in $(dir "$BASE"/raw); do
|
|
|
|
[[ ! -e $STATUS/archived/$recording.norecord ]] && mark_for_rebuild "$recording"
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
|
|
|
fi
|
2013-09-24 06:36:53 +08:00
|
|
|
|
2012-08-14 05:25:57 +08:00
|
|
|
if [ $REPUBLISH ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ -z "$MEETING_ID" ]; then
|
|
|
|
#
|
|
|
|
# Republish all meetings
|
|
|
|
#
|
2022-01-10 20:44:50 +08:00
|
|
|
for recording in $(dir "$BASE"/raw); do
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Marking for republish: $recording"
|
2022-01-10 20:44:50 +08:00
|
|
|
mark_for_republish "$recording"
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
|
|
|
else
|
|
|
|
echo "Marking for republish: $MEETING_ID"
|
2022-01-10 20:44:50 +08:00
|
|
|
mark_for_republish "$MEETING_ID"
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
|
|
|
fi
|
2011-08-26 06:47:03 +08:00
|
|
|
|
2012-08-22 09:05:22 +08:00
|
|
|
if [ $CLEAN ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
sudo /etc/init.d/bbb-record-core stop
|
|
|
|
for type in $TYPES; do
|
2022-01-08 21:58:47 +08:00
|
|
|
echo " clearning logs in $LOG_DIR/$type"
|
2022-01-10 20:44:50 +08:00
|
|
|
find "$LOG_DIR"/"$type" -name "*.log" -exec sudo rm '{}' \;
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
|
|
|
sudo /etc/init.d/bbb-record-core start
|
2012-08-22 09:05:22 +08:00
|
|
|
fi
|
|
|
|
|
2012-02-28 00:40:35 +08:00
|
|
|
if [ $DELETE ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
if [[ -z $MEETING_ID ]]; then
|
|
|
|
echo "No meeting id given"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "deleting: $MEETING_ID"
|
|
|
|
# Remove the status files first to avoid issues with concurrent
|
|
|
|
# recording processing
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -f "$STATUS"/ended/"$MEETING_ID"*
|
|
|
|
rm -f "$STATUS"/recorded/"$MEETING_ID"*
|
|
|
|
rm -f "$STATUS"/archived/"$MEETING_ID"*
|
|
|
|
rm -f "$STATUS"/sanity/"$MEETING_ID"*
|
|
|
|
rm -f "$STATUS"/processed/"$MEETING_ID"*
|
|
|
|
rm -f "$STATUS"/published/"$MEETING_ID"*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
|
|
|
# Remove all of the related files
|
|
|
|
for type in $TYPES; do
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${PUBLISHED_DIR:?}"/"$type"/"$MEETING_ID"*
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/unpublished/"$type"/"$MEETING_ID"*
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/deleted/"$type"/"$MEETING_ID"*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "$RECORDING_DIR"/process/"$type"/"$MEETING_ID"*
|
|
|
|
rm -rf "$RECORDING_DIR"/publish/"$type"/"$MEETING_ID"*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${LOG_DIR:?}"/"$type"/*"$MEETING_ID"*
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/captions/"$MEETING_ID"*
|
|
|
|
rm -f "$RAW_PRESENTATION_SRC"/inbox/"$MEETING_ID"*.json
|
|
|
|
rm -f "$RAW_PRESENTATION_SRC"/inbox/"$MEETING_ID"*.txt
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "$RECORDING_DIR"/raw/"$MEETING_ID"*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -f "$RAW_PRESENTATION_SRC"/screenshare/"$MEETING_ID"*.flv
|
|
|
|
rm -f "$RAW_AUDIO_SRC"/"$MEETING_ID"*.wav
|
|
|
|
rm -f "$RAW_AUDIO_SRC"/"$MEETING_ID"*.opus
|
|
|
|
rm -rf "${RAW_PRESENTATION_SRC:?}"/"$MEETING_ID"
|
2012-02-28 00:40:35 +08:00
|
|
|
fi
|
|
|
|
|
2011-09-01 02:55:20 +08:00
|
|
|
if [ $DELETEALL ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
# Remove the status files first to avoid issues with concurrent
|
|
|
|
# recording processing
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -f "$STATUS"/recorded/*
|
|
|
|
rm -f "$STATUS"/archived/*
|
|
|
|
rm -f "$STATUS"/sanity/*
|
|
|
|
rm -f "$STATUS"/processed/*
|
|
|
|
rm -f "$STATUS"/published/*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
|
|
|
for type in $TYPES; do
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${PUBLISHED_DIR:?}"/"$type"/*
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/unpublished/"$type"/*
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/deleted/"$type"/*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "$RECORDING_DIR"/process/"$type"/*
|
|
|
|
rm -rf "$RECORDING_DIR"/publish/"$type"/*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${LOG_DIR:?}"/"$type"/*
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "$RECORDING_DIR"/raw/*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -f "$RAW_PRESENTATION_SRC"/captions/inbox/*
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -f "$RAW_PRESENTATION_SRC"/screenshare/*.flv
|
|
|
|
rm -f "$RAW_AUDIO_SRC"/*.wav
|
|
|
|
rm -f "$RAW_AUDIO_SRC"/*.opus
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-12 00:20:45 +08:00
|
|
|
for meeting in $(ls "$RAW_PRESENTATION_SRC" | grep "$MEETING_PATTERN"); do
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "deleting: $meeting"
|
2022-01-10 20:44:50 +08:00
|
|
|
rm -rf "${RAW_PRESENTATION_SRC:?}"/"$meeting"
|
|
|
|
rm -rf "$RAW_PRESENTATION_SRC"/captions/"$meeting"
|
2020-11-17 06:32:39 +08:00
|
|
|
done
|
2011-08-26 06:47:03 +08:00
|
|
|
fi
|
|
|
|
|
2011-09-10 21:35:32 +08:00
|
|
|
if [ $LIST ]; then
|
2011-08-26 06:47:03 +08:00
|
|
|
|
2020-11-17 06:32:39 +08:00
|
|
|
# Does the meeting contain:
|
|
|
|
# A -- Audio
|
|
|
|
# P -- Presentation
|
|
|
|
# V -- Video
|
|
|
|
# D -- Desktop
|
|
|
|
#
|
|
|
|
# Does the archive contain
|
|
|
|
# A -- Audio
|
|
|
|
# P -- Presentation
|
|
|
|
# V -- Video
|
|
|
|
# D -- Desktop
|
|
|
|
# E -- Events
|
|
|
|
#
|
|
|
|
# Is there a done flag (trigger rap-worker.rb to process) for
|
|
|
|
# R -- Recording
|
|
|
|
# A -- Archiving
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ $WITHDESC ]; then
|
|
|
|
echo "Internal MeetingID Time APVD APVDE RAS Slides Processed Published External MeetingID Description"
|
|
|
|
echo "------------------------------------------------------ ---------------------------- ---- ----- --- ------ -------------------- ------------------ ------------------- -----------"
|
|
|
|
else
|
|
|
|
echo "Internal MeetingID Time APVD APVDE RAS Slides Processed Published External MeetingID"
|
|
|
|
echo "------------------------------------------------------ ---------------------------- ---- ----- --- ------ -------------------- ------------------ -------------------"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z $HEAD ]; then
|
|
|
|
# If we're not called with --list-recent, show all recordings
|
|
|
|
HEAD=99999
|
|
|
|
fi
|
|
|
|
|
|
|
|
tmp_file=$(mktemp)
|
2022-01-12 00:20:45 +08:00
|
|
|
ls -t "$RAW_PRESENTATION_SRC" | grep "$MEETING_PATTERN" -m $HEAD > "$tmp_file"
|
|
|
|
ls -t "$RECORDING_DIR"/raw | grep "$MEETING_PATTERN" -m $HEAD >> "$tmp_file"
|
|
|
|
#for meeting in $(ls -t $RAW_PRESENTATION_SRC | grep $MEETING_PATTERN -m $HEAD); do
|
2022-01-10 20:44:50 +08:00
|
|
|
for meeting in $(sort -t - -k 2 -r < "$tmp_file" | uniq); do
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "$meeting"
|
2022-01-10 20:44:50 +08:00
|
|
|
timestamp=${meeting//[0-9a-f]*-/}
|
|
|
|
epoc=$((timestamp/1000))
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n " "
|
2022-01-10 20:44:50 +08:00
|
|
|
echo -n "$(date --date "Jan 1, 1970 00:00:00 +0000 + $epoc seconds")" | awk '{ printf("%-28s",$0) }'
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n " "
|
|
|
|
|
|
|
|
#
|
|
|
|
# Monitor the live recordings
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check if there is any recorded audio
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls -A "$RAW_AUDIO_SRC"/"$meeting"-*.wav &> /dev/null; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check if there is any uploaded presentations
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$RAW_PRESENTATION_SRC"/"$meeting"/"$meeting" ]; then
|
|
|
|
if [ "$(ls -A "$RAW_PRESENTATION_SRC"/"$meeting"/"$meeting")" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check if there is any recorded videos
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$RAW_VIDEO_SRC"/"$meeting" ]; then
|
|
|
|
if [ "$(ls -A "$RAW_VIDEO_SRC"/"$meeting")" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
|
|
|
|
#echo "## $RAW_SCREENSHARE_SRC/$meeting-*.flv"
|
|
|
|
#exit
|
|
|
|
#
|
|
|
|
# Check if there is any recorded desktop sharing
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls -A "$RAW_SCREENSHARE_SRC"/"$meeting"/*.flv &> /dev/null; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Monitor the archived files
|
|
|
|
#
|
|
|
|
RAW_DIR=$RAW_PRESENTATION_SRC/recording/raw/$meeting
|
|
|
|
echo -n " "
|
|
|
|
|
|
|
|
# Check if there area uploaded presentations
|
|
|
|
#echo "$RAW/audio"
|
|
|
|
DIRS="audio presentation video deskshare"
|
|
|
|
for dir in $DIRS; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$RAW_DIR"/"$dir" ]; then
|
|
|
|
if [ "$(ls -A "$RAW_DIR"/"$dir")" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$RAW_DIR"/events.xml ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check the status files
|
|
|
|
#
|
|
|
|
echo -n " "
|
|
|
|
DIRS="recorded archived sanity"
|
|
|
|
for dir in $DIRS; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$STATUS"/"$dir"/"$meeting".done ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "X"
|
|
|
|
else
|
|
|
|
echo -n " "
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Number of slides
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$RAW_PRESENTATION_SRC"/"$meeting"/"$meeting" ]; then
|
|
|
|
SLIDES_COUNT=$(find "$RAW_PRESENTATION_SRC"/"$meeting"/"$meeting" -name "*.swf" | wc -l)
|
|
|
|
if [ "$SLIDES_COUNT" -eq 0 ]; then
|
|
|
|
SLIDES_COUNT=$(find "$RAW_PRESENTATION_SRC"/"$meeting"/"$meeting" -name "*.svg" | wc -l)
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
printf "%7s" "$SLIDES_COUNT"
|
2020-11-17 06:32:39 +08:00
|
|
|
else
|
2022-01-10 20:44:50 +08:00
|
|
|
SLIDES_COUNT=$(find "$RECORDING_DIR"/raw/"$meeting" -name "*.swf" | wc -l)
|
|
|
|
if [ "$SLIDES_COUNT" -eq 0 ]; then
|
|
|
|
SLIDES_COUNT=$(find "$RECORDING_DIR"/raw/"$meeting" -name "*.svg" | wc -l)
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
2022-01-10 20:44:50 +08:00
|
|
|
printf "%7s" "$SLIDES_COUNT"
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo -n " "
|
|
|
|
#echo $BASE/raw/$meeting
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$BASE"/raw/"$meeting" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
recording=$meeting
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check processed
|
|
|
|
processed=""
|
|
|
|
for type in $TYPES; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$STATUS"/processed/"$recording"-"$type".done ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ ! -z "$processed" ]; then
|
|
|
|
processed="$processed,"
|
|
|
|
fi
|
|
|
|
processed="$processed$type"
|
|
|
|
fi
|
|
|
|
done
|
2022-01-10 20:44:50 +08:00
|
|
|
printf "%-21s" "$processed"
|
2020-11-17 06:32:39 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Check archived
|
|
|
|
published=""
|
|
|
|
for type in $TYPES; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$PUBLISHED_DIR"/"$type"/"$recording"/metadata.xml ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ ! -z "$published" ]; then
|
|
|
|
published="$published,"
|
|
|
|
fi
|
|
|
|
published="$published$type"
|
|
|
|
fi
|
|
|
|
done
|
2022-01-10 20:44:50 +08:00
|
|
|
printf "%-17s" "$published"
|
2020-11-17 06:32:39 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$RECORDING_DIR"/raw/"$recording"/events.xml ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n " "
|
2022-01-10 20:44:50 +08:00
|
|
|
echo -n "$(head -n 5 "$RECORDING_DIR"/raw/"$recording"/events.xml | grep meetingId | sed s/.*meetingId=\"//g | sed s/\".*//g)" | sed -e 's/<[^>]*>//g' -e 's/</</g' -e 's/>/>/g' -e 's/&/\&/g' -e 's/ \{1,\}/ /g' | tr -d '\n'
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ $WITHDESC ]; then
|
|
|
|
echo -n " "
|
2022-01-10 20:44:50 +08:00
|
|
|
echo -n "$(head -n 5 "$RECORDING_DIR"/raw/"$recording"/events.xml | grep description | sed s/.*description=\"//g | sed s/\".*//g)" | sed -e 's/<[^>]*>//g' -e 's/</</g' -e 's/>/>/g' -e 's/&/\&/g' -e 's/ \{1,\}/ /g' | tr -d '\n'
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
done
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$tmp_file" ]; then
|
|
|
|
rm "$tmp_file"
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
|
|
|
echo
|
|
|
|
echo "--"
|
|
|
|
systemctl --all --no-pager list-timers bbb-record-core.timer
|
|
|
|
echo "--"
|
|
|
|
systemctl --no-pager status bbb-rap-starter.service bbb-rap-resque-worker.service
|
|
|
|
echo "--"
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if tail -n 20 "$LOG_DIR"/bbb-web.log | grep -q "is recorded. Process it."; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo -n "Last meeting processed (bbb-web.log): "
|
2022-01-10 20:44:50 +08:00
|
|
|
tail -n 20 "$LOG_DIR"/bbb-web.log | grep "is recorded. Process it." | sed "s/.*\[//g" | sed "s/\].*//g"
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
2011-08-26 06:47:03 +08:00
|
|
|
fi
|
|
|
|
|
2011-09-10 21:35:32 +08:00
|
|
|
if [ $WATCH ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
watch -n 2 "bbb-record --list-recent $WITHDESC"
|
2011-09-10 21:35:32 +08:00
|
|
|
fi
|
2012-01-06 06:07:34 +08:00
|
|
|
|
2013-04-04 07:00:47 +08:00
|
|
|
if [ $ENABLE ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
SCRIPTS_DIR=/usr/local/bigbluebutton/core/scripts
|
|
|
|
PROCESS_SCRIPT=$SCRIPTS_DIR/process/$WORKFLOW
|
|
|
|
PUBLISH_SCRIPT=$SCRIPTS_DIR/publish/$WORKFLOW
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$PROCESS_SCRIPT".rb.bk ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Enabling process script in workflow '$WORKFLOW'"
|
2022-01-10 20:44:50 +08:00
|
|
|
mv "$PROCESS_SCRIPT".rb.bk "$PROCESS_SCRIPT".rb
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Enabling publish script in workflow '$WORKFLOW'"
|
2022-01-10 20:44:50 +08:00
|
|
|
mv "$PUBLISH_SCRIPT".rb.bk "$PUBLISH_SCRIPT".rb
|
|
|
|
elif [ -f "$PROCESS_SCRIPT".rb ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Workflow '$WORKFLOW' is already enabled."
|
|
|
|
else
|
|
|
|
echo "Workflow '$WORKFLOW' does not exist or is not installed"
|
|
|
|
fi
|
2013-04-04 07:00:47 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $DISABLE ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
SCRIPTS_DIR=/usr/local/bigbluebutton/core/scripts
|
|
|
|
PROCESS_SCRIPT=$SCRIPTS_DIR/process/$WORKFLOW
|
|
|
|
PUBLISH_SCRIPT=$SCRIPTS_DIR/publish/$WORKFLOW
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$PROCESS_SCRIPT".rb ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Disabling process script in workflow '$WORKFLOW'"
|
2022-01-10 20:44:50 +08:00
|
|
|
mv "$PROCESS_SCRIPT".rb "$PROCESS_SCRIPT".rb.bk
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Disabling publish script in workflow '$WORKFLOW'"
|
2022-01-10 20:44:50 +08:00
|
|
|
mv "$PUBLISH_SCRIPT".rb "$PUBLISH_SCRIPT".rb.bk
|
|
|
|
elif [ -f "$PROCESS_SCRIPT".rb.bk ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "Workflow '$WORKFLOW' is already disabled."
|
|
|
|
else
|
|
|
|
echo "Workflow '$WORKFLOW' does not exist or is not installed"
|
|
|
|
fi
|
2013-04-04 07:00:47 +08:00
|
|
|
fi
|
|
|
|
|
2013-04-06 06:37:05 +08:00
|
|
|
if [ $TOEXTERNAL ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo
|
|
|
|
echo "External meeting id related to the given internal meeting id:"
|
|
|
|
echo "-------------------------------------------------------------"
|
2022-01-10 20:44:50 +08:00
|
|
|
expr "$(grep meetingId "$RECORDING_DIR"/raw/"$INTERNAL_MEETINGID"/events.xml 2> /dev/null)" : '.*meetingId="\(.*\)"'
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "-------------------------------------------------------------"
|
|
|
|
echo
|
2013-04-06 06:37:05 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $TOINTERNAL ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo
|
|
|
|
echo "Internal meeting ids related to the given external meeting id:"
|
|
|
|
echo "-------------------------------------------------------------"
|
2022-01-10 20:44:50 +08:00
|
|
|
grep "meetingId=\"$EXTERNAL_MEETINGID\"" "$RECORDING_DIR"/raw/*/events.xml | cut -f6 -d'/'
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "-------------------------------------------------------------"
|
|
|
|
echo
|
2013-04-06 06:37:05 +08:00
|
|
|
fi
|
|
|
|
|
2013-04-06 04:57:34 +08:00
|
|
|
#if [ $REARCHIVE ]; then
|
2022-01-08 21:58:47 +08:00
|
|
|
# ARCHIVE_DONE_FILE=$STATUS/archived/$MEETING_ID.done
|
|
|
|
# SANITY_FAIL_FILE=$STATUS/sanity/$MEETING_ID.fail
|
2020-11-17 06:32:39 +08:00
|
|
|
# if [ -f $SANITY_FAIL_FILE ]; then
|
|
|
|
# max_days=$(expr "$(grep history= /etc/cron.daily/bigbluebutton)" : 'history=\(.*\)')
|
|
|
|
# # The recording has not been removed.
|
2022-01-08 21:58:47 +08:00
|
|
|
# still_exists=$(find $STATUS/recorded/*.done -mtime -$max_days | grep $MEETING_ID)
|
2020-11-17 06:32:39 +08:00
|
|
|
# if [ -n "$still_exists" ]; then
|
|
|
|
# if [ -f $ARCHIVE_DONE_FILE ]; then
|
|
|
|
# echo "Removing archived .done file, sanity .fail fail, and raw directory for meeting $MEETING_ID"
|
|
|
|
# rm $ARCHIVE_DONE_FILE
|
2022-01-08 21:58:47 +08:00
|
|
|
# rm -r $RECORDING_DIR/raw/$MEETING_ID
|
2020-11-17 06:32:39 +08:00
|
|
|
# rm $SANITY_FAIL_FILE
|
|
|
|
# else
|
|
|
|
# echo "$MEETING_ID is not archived."
|
|
|
|
# fi
|
|
|
|
# fi
|
|
|
|
# else
|
|
|
|
# echo "The meeting you want to re archive has not failed in sanity check."
|
|
|
|
# fi
|
2013-04-06 04:57:34 +08:00
|
|
|
#fi
|
2013-04-04 08:13:02 +08:00
|
|
|
|
2022-01-07 21:23:06 +08:00
|
|
|
if [ $LISTWORKFLOWS ]; then
|
|
|
|
echo
|
2022-01-21 01:40:12 +08:00
|
|
|
echo "# Enabled recording processing steps:"
|
|
|
|
echo "#"
|
|
|
|
prev_workflow=""
|
|
|
|
for workflow in $(get_yml_value steps); do
|
|
|
|
# Remove trailing : if present
|
|
|
|
workflow=$(sed "s/:$//" <<< $workflow)
|
|
|
|
if [ "$prev_workflow" != "$workflow" ]; then
|
|
|
|
echo "# $workflow"
|
|
|
|
fi
|
|
|
|
prev_workflow=$workflow
|
|
|
|
done
|
|
|
|
echo "#"
|
|
|
|
echo "# Available processing scripts: "
|
2022-01-07 21:23:06 +08:00
|
|
|
echo "#"
|
|
|
|
for type in $TYPES; do
|
|
|
|
echo "# $type"
|
|
|
|
done
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2012-01-06 06:07:34 +08:00
|
|
|
if [ $CHECK ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
print_header
|
|
|
|
echo
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$RECORDING_DIR"/process/slides ]; then
|
|
|
|
if [ ! -w "$RECORDING_DIR"/process/slides ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
echo "# Error: The output directory for slides"
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "#"
|
2022-01-08 21:58:47 +08:00
|
|
|
echo "# $RECORDING_DIR/process/slides"
|
2020-11-17 06:32:39 +08:00
|
|
|
echo "#"
|
|
|
|
echo "# is not writeable."
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
2022-01-07 04:47:04 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$PLAYBACK_PROTOCOL" != "https" ]; then
|
2022-01-07 19:21:44 +08:00
|
|
|
echo "#"
|
|
|
|
echo "# Info: playback protocol set to $PLAYBACK_PROTOCOL instead of https"
|
|
|
|
echo "#"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -d "$LOG_DIR" ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$(stat -c %a "$LOG_DIR")" != "755" ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
echo "#"
|
2022-01-10 20:44:50 +08:00
|
|
|
echo "# Warning: access rights of BigBlueButton's log directory should be set to rwxr-xr-x, not $(stat -c %A "$LOG_DIR"):"
|
2022-01-07 04:47:04 +08:00
|
|
|
echo "# chmod 755 $LOG_DIR"
|
|
|
|
echo "#"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
check_path_owner_group "$LOG_DIR" "-d" "-R"
|
2022-01-07 04:47:04 +08:00
|
|
|
check_path_owner_group "$LOG_DIR/bbb-rap-worker.log" "-f"
|
|
|
|
check_path_owner_group "$LOG_DIR/sanity.log" "-f"
|
|
|
|
check_path_owner_group "$LOG_DIR/post_process.log" "-f"
|
2022-01-13 20:25:06 +08:00
|
|
|
check_path_owner_group "$LOG_DIR/post_publish.log" "-f"
|
2022-01-07 04:47:04 +08:00
|
|
|
check_path_owner_group "$LOG_DIR/bbb-recording-cleanup.log" "-f"
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "# Error: Recording log directory $LOG_DIR is missing."
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
check_path_owner_group "$RECORDING_DIR" "-d" "-R"
|
2022-01-11 05:56:02 +08:00
|
|
|
check_path_owner_group "$RECORDING_DIR/raw" "-d" "-R"
|
|
|
|
check_path_owner_group "$RECORDING_DIR/process" "-d" "-R"
|
|
|
|
check_path_owner_group "$RECORDING_DIR/publish" "-d" "-R"
|
|
|
|
|
|
|
|
check_path_owner_group "$STATUS" "-d" "-R"
|
|
|
|
check_path_owner_group "$STATUS/recorded" "-d" "-R"
|
|
|
|
check_path_owner_group "$STATUS/archived" "-d" "-R"
|
|
|
|
check_path_owner_group "$STATUS/processed" "-d" "-R"
|
|
|
|
check_path_owner_group "$STATUS/sanity" "-d" "-R"
|
|
|
|
check_path_owner_group "$STATUS/published" "-d" "-R"
|
2022-01-07 04:47:04 +08:00
|
|
|
|
2022-01-12 00:20:45 +08:00
|
|
|
check_path_owner_group "$RAW_PRESENTATION_SRC" "-d" "-R"
|
2022-01-11 05:56:02 +08:00
|
|
|
check_path_owner_group "$RAW_PRESENTATION_SRC/captions" "-d" "-R"
|
|
|
|
check_path_owner_group "$RAW_PRESENTATION_SRC/events" "-d"
|
2012-09-13 02:52:36 +08:00
|
|
|
|
2022-01-08 21:58:47 +08:00
|
|
|
check_path_owner_group "$PUBLISHED_DIR" "-d"
|
|
|
|
check_path_owner_group "$RAW_PRESENTATION_SRC/deleted" "-d"
|
|
|
|
check_path_owner_group "$RAW_PRESENTATION_SRC/unpublished" "-d"
|
|
|
|
check_path_owner_group "$RAW_PRESENTATION_SRC/basic_stats" "-d"
|
2022-01-07 04:47:04 +08:00
|
|
|
|
|
|
|
for type in $TYPES; do
|
|
|
|
check_path_owner_group "$LOG_DIR/$type" "-d" "-R"
|
|
|
|
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ "$(find "$LOG_DIR"/"$type" \! -user $BBB_USER \! -group $BBB_USER | wc -l)" -gt 0 ]; then
|
2022-01-07 04:47:04 +08:00
|
|
|
echo "#"
|
|
|
|
echo "# Some recording log files in $LOG_DIR/$type may not be writeable."
|
|
|
|
echo "# Consider running 'chown -hR $BBB_USER:$BBB_USER $LOG_DIR/$type'"
|
|
|
|
echo "# if recording processing is not automatically starting."
|
|
|
|
echo "#"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
done
|
2012-02-27 04:00:37 +08:00
|
|
|
fi
|
2012-01-06 06:07:34 +08:00
|
|
|
|
2012-02-27 04:00:37 +08:00
|
|
|
if [ $DEBUG ]; then
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$LOG_DIR"/bbb-rap-worker.log ]; then
|
|
|
|
grep -i error "$LOG_DIR"/bbb-rap-worker.*
|
2020-11-17 06:32:39 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
#Failures while archiving files
|
|
|
|
#
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ -f "$LOG_DIR"/archive.log ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
grep "Failed to" "$LOG_DIR/archive.log" > /tmp/t
|
|
|
|
if [ -s /tmp/t ]; then
|
|
|
|
echo " -- ERRORS found while archiving files -- "
|
|
|
|
cat /tmp/t
|
|
|
|
echo
|
|
|
|
grep "on ASCII" /tmp/t > /tmp/u
|
|
|
|
if [ -s /tmp/u ]; then
|
|
|
|
echo " -- events.xml was not created. There is a problem with the character encoding "
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# We're going to look through the output files for each of the processed types
|
|
|
|
#
|
|
|
|
STAGES="process publish"
|
|
|
|
for type in $TYPES; do
|
|
|
|
for stage in $STAGES; do
|
|
|
|
LOC=$LOG_DIR/$type/$stage
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls -A "$LOC"-* &> /dev/null; then
|
2020-11-17 06:32:39 +08:00
|
|
|
rm -rf /tmp/t
|
2022-01-10 20:44:50 +08:00
|
|
|
grep -B 3 "ERROR -- : Error:" "$LOC"-* | grep -E -w 'Error:' | grep -v "ffmpeg version" > /tmp/t
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ -s /tmp/t ]; then
|
|
|
|
echo " -- ERRORS found while processing slides $LOC-* -- "
|
|
|
|
cat /tmp/t
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Additional checks for record and playback
|
|
|
|
#
|
|
|
|
rm -rf /tmp/t
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls "$LOG_DIR"/slides-process-* > /dev/null 2>&1; then
|
|
|
|
sudo grep -i Error "$LOG_DIR"/slides-process-* | sudo tee /tmp/t
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ -s /tmp/t ]; then
|
2022-01-08 21:58:47 +08:00
|
|
|
echo " -- Ingest and Processing errors found in $LOG_DIR/slides-process-*.log -- "
|
2020-11-17 06:32:39 +08:00
|
|
|
cat /tmp/t
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf /tmp/t
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls "$LOG_DIR"/slides-publish-* > /dev/null 2>&1; then
|
|
|
|
sudo grep -i Error "$LOG_DIR"/slides-publish-* | sudo tee /tmp/t
|
2020-11-17 06:32:39 +08:00
|
|
|
if [ -s /tmp/t ]; then
|
2022-01-08 21:58:47 +08:00
|
|
|
echo " -- Ingest and Processing errors found in $LOG_DIR/slides-publish-*.log -- "
|
2020-11-17 06:32:39 +08:00
|
|
|
cat /tmp/t
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf /tmp/t
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls "$LOG_DIR"/slides-process-* > /dev/null 2>&1; then
|
2022-01-08 21:58:47 +08:00
|
|
|
for file in $LOG_DIR/slides-process-*; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ ! -f "${file//process/publish}" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo " $file" >> /tmp/t
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -s /tmp/t ]; then
|
|
|
|
echo " -- Ingest and Processing: found process file but not publish -- "
|
|
|
|
cat /tmp/t
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf /tmp/t
|
2022-01-10 20:44:50 +08:00
|
|
|
if ls "$STATUS"/recorded/*.done > /dev/null 2>&1; then
|
2022-01-08 21:58:47 +08:00
|
|
|
for file in $STATUS/recorded/*.done; do
|
2022-01-10 20:44:50 +08:00
|
|
|
if [ ! -f "${file//recorded/archived}" ]; then
|
2020-11-17 06:32:39 +08:00
|
|
|
echo " $file" >> /tmp/t
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -s /tmp/t ]; then
|
|
|
|
echo " -- Ingest and Processing: found recorded meeting but no archive files-- "
|
|
|
|
cat /tmp/t
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|
2012-01-06 06:07:34 +08:00
|
|
|
fi
|