|
@@ -1,7 +1,39 @@
|
1
|
1
|
#!/bin/sh
|
2
|
2
|
now=$(date)
|
|
3
|
+
|
3
|
4
|
echo "======================"
|
4
|
5
|
echo "Current Date: $now"
|
5
|
6
|
bbb-conf --clean
|
6
|
7
|
echo "======================"
|
7
|
|
-#TODO: Remove OLD recordings
|
|
8
|
+
|
|
9
|
+MAXAGE=15
|
|
10
|
+LOGFILE=/var/log/bigbluebutton/bbb-recording-cleanup.log
|
|
11
|
+shopt -s nullglob
|
|
12
|
+
|
|
13
|
+NOW=$(date +%s)
|
|
14
|
+
|
|
15
|
+echo "$(date --rfc-3339=seconds) Deleting recordings older than ${MAXAGE} days" >>"${LOGFILE}"
|
|
16
|
+
|
|
17
|
+for donefile in /var/bigbluebutton/recording/status/published/*-presentation.don e ; do
|
|
18
|
+ MTIME=$(stat -c %Y "${donefile}")
|
|
19
|
+ # Check the age of the recording
|
|
20
|
+ if [ $(( ( $NOW - $MTIME ) / 86400 )) -gt $MAXAGE ]; then
|
|
21
|
+ MEETING_ID=$(basename "${donefile}")
|
|
22
|
+ MEETING_ID=${MEETING_ID%-presentation.done}
|
|
23
|
+ echo "${MEETING_ID}" >> "${LOGFILE}"
|
|
24
|
+
|
|
25
|
+ bbb-record --delete "${MEETING_ID}" >>"${LOGFILE}"
|
|
26
|
+ fi
|
|
27
|
+done
|
|
28
|
+
|
|
29
|
+for eventsfile in /var/bigbluebutton/recording/raw/*/events.xml ; do
|
|
30
|
+ MTIME=$(stat -c %Y "${eventsfile}")
|
|
31
|
+ # Check the age of the recording
|
|
32
|
+ if [ $(( ( $NOW - $MTIME ) / 86400 )) -gt $MAXAGE ]; then
|
|
33
|
+ MEETING_ID="${eventsfile%/events.xml}"
|
|
34
|
+ MEETING_ID="${MEETING_ID##*/}"
|
|
35
|
+ echo "${MEETING_ID}" >> "${LOGFILE}"
|
|
36
|
+
|
|
37
|
+ bbb-record --delete "${MEETING_ID}" >>"${LOGFILE}"
|
|
38
|
+ fi
|
|
39
|
+done
|