How to Set Up Automated Recording Cleanup in BigBlueButton

Recording storage can grow quickly on a busy BigBlueButton server, but “cleanup” can mean two very different things: removing raw source data after a recording has been published, or deleting the published recording itself after a retention period. Choosing the wrong one can either waste disk space or remove content earlier than your users expect.

This guide focuses on BigBlueButton 3.0, which the official documentation lists as the current production branch as of October 2026. BigBlueButton 4.0 documentation is available but is still marked as in development. For production systems, confirm your installed version with bbb-conf --check before copying retention settings from documentation for another branch. See the official BigBlueButton installation documentation.

Choose the cleanup policy before changing anything

There is no single retention value that fits every deployment. A university may need semester-long playback access, while an internal training server may only need recordings for 30 days. The useful distinction is between raw recording data and published playback files.

Cleanup choiceWhat it savesMain tradeoffBest fit
Delete raw data after publicationRaw media and processing materialYou lose the ability to rebuild a recording from the original raw data after it is removedServers that want to keep published playback but control disk growth
Delete complete recordings after N daysPublished and associated recording dataThe recording is no longer available to usersClear retention policies such as 30, 60, or 90 days
Application-controlled deletionDepends on the integrationMore policy flexibility, but more application logic and operational complexityMulti-tenant systems or LMS workflows with per-course retention rules

BigBlueButton’s official customization guide says raw data is retained so administrators can rebuild a recording if processing fails, add another recording format, or recover from an accidental deletion. That benefit has a storage cost. The same documentation states that BigBlueButton removes raw data for published recordings after 14 days by default. See Server Customization in the official BigBlueButton documentation.

Terminal showing BigBlueButton recording disk usage and the recent recording list
Check current disk usage and recent recordings before choosing a retention period. The important baseline is how quickly /var/bigbluebutton is growing and which recordings users still need.

Option 1: keep published recordings but remove raw data

If your main problem is disk consumption but users still need playback links, start with the built-in raw-data retention setting. BigBlueButton’s daily maintenance script is located at /etc/cron.daily/bigbluebutton. The documented default is:

published_days=14

The script also calls the raw-recording cleanup function for published recordings. Increasing published_days gives you a longer recovery window for rebuilds; decreasing it reduces storage use sooner. A value such as 30 days may be reasonable when administrators routinely need time to discover recording defects, while a shorter period is more appropriate when storage is constrained and published output is routinely checked soon after meetings.

Do not confuse this with a full retention policy. Changing published_days does not mean the published recording itself will disappear after that many days. It controls how long the raw data remains available after publication.

Nano editor showing the BigBlueButton daily cron file with published_days retention
The built-in daily maintenance file contains the published_days setting used for raw data from published recordings.

Option 2: delete complete recordings older than a fixed age

If your requirement is “recordings must disappear after 30 days,” BigBlueButton documents a separate daily cleanup script. The official example creates /etc/cron.daily/bbb-recording-cleanup, checks the age of published status files and raw recording data, and calls bbb-record --delete for recordings older than the configured maximum age.

Before enabling deletion, inspect the candidate set. For a 30-day policy, this read-only command helps you see which published presentation status files are older than the threshold:

sudo find /var/bigbluebutton/recording/status/published \
  -type f -name '*-presentation.done' -mtime +30 -print

This is not a BigBlueButton dry-run command; it is simply a safe filesystem check. Use it to catch policy mistakes before an automated job starts deleting data.

Terminal listing recent BigBlueButton recordings before automated cleanup
Review recent recordings and their dates before enforcing a full-retention policy.

Create the cleanup script

Create /etc/cron.daily/bbb-recording-cleanup. The following implementation follows the paths and deletion approach described in BigBlueButton’s official customization guide, while keeping the retention value and log file easy to find:

#!/bin/bash
set -u

MAXAGE=30
LOGFILE=/var/log/bigbluebutton/bbb-recording-cleanup.log
NOW=$(date +%s)

shopt -s nullglob

for donefile in /var/bigbluebutton/recording/status/published/*-presentation.done; do
    MTIME=$(stat -c %Y "$donefile")
    AGE=$(( (NOW - MTIME) / 86400 ))

    if [ "$AGE" -gt "$MAXAGE" ]; then
        MEETING_ID=$(basename "$donefile")
        MEETING_ID=${MEETING_ID%-presentation.done}
        echo "$(date --rfc-3339=seconds) deleting $MEETING_ID age=${AGE}d" >> "$LOGFILE"
        bbb-record --delete "$MEETING_ID" >> "$LOGFILE" 2>&1
    fi
done

for eventsfile in /var/bigbluebutton/recording/raw/*/events.xml; do
    MTIME=$(stat -c %Y "$eventsfile")
    AGE=$(( (NOW - MTIME) / 86400 ))

    if [ "$AGE" -gt "$MAXAGE" ]; then
        MEETING_ID=${eventsfile%/events.xml}
        MEETING_ID=${MEETING_ID##*/}
        echo "$(date --rfc-3339=seconds) deleting raw $MEETING_ID age=${AGE}d" >> "$LOGFILE"
        bbb-record --delete "$MEETING_ID" >> "$LOGFILE" 2>&1
    fi
done

Set MAXAGE to your policy, not to an arbitrary low number. For example, 30 days gives a smaller storage footprint but a shorter recovery and access window than 90 days. If recordings are part of a formal retention requirement, confirm the policy with the data owner before enabling deletion.

Nano editor showing a BigBlueButton cleanup script with MAXAGE and bbb-record delete logic
A cleanup script can identify old published recordings by age and pass their internal meeting IDs to bbb-record --delete.
Nano editor showing another view of the daily BigBlueButton recording cleanup script
The cleanup logic should operate on BigBlueButton recording status and raw-data paths rather than deleting arbitrary directories by name.

Make the daily script executable

sudo chmod +x /etc/cron.daily/bbb-recording-cleanup
sudo ls -l /etc/cron.daily/bbb-recording-cleanup

The filename intentionally has no extension. Ubuntu’s daily-job mechanism commonly uses run-parts, whose filename rules can cause some dotted names to be skipped. Keeping the documented name bbb-recording-cleanup avoids that unnecessary source of confusion.

The tradeoff of /etc/cron.daily is simplicity rather than exact timing. If you need cleanup at a precise low-traffic hour, a root cron entry or systemd timer can provide tighter scheduling, but that becomes your own operating-system customization rather than the BigBlueButton-documented default. Track and test it separately.

Run the cleanup manually once before trusting automation

After reviewing the candidate files, run the script once from the shell:

sudo /etc/cron.daily/bbb-recording-cleanup
sudo tail -n 50 /var/log/bigbluebutton/bbb-recording-cleanup.log

BigBlueButton documents bbb-record --delete <internal-meeting-id> as the command that removes a meeting’s data and its recording. The recording documentation also warns that this command can wipe a running meeting. A sensible retention policy therefore uses a large enough age threshold that an active meeting can never qualify, and it deletes only IDs discovered from old recording artifacts. See the official Record and Playback documentation.

Terminal running the daily BigBlueButton recording cleanup script and displaying its log
Run the cleanup job manually once and inspect its log before relying on unattended daily execution.
Terminal showing completed BigBlueButton recording deletions in the cleanup log
A useful cleanup log records which internal meeting IDs were deleted and when the job completed.

Verify that cleanup is doing what you intended

Verification should cover both user-visible recordings and disk use. Start with BigBlueButton’s own recording commands:

sudo bbb-record --list-recent
sudo bbb-record --check

bbb-record --list-recent shows the ten most recent recordings. bbb-record --check checks recording configuration and permissions in BigBlueButton 2.5 and later. Neither command replaces storage monitoring, so also measure the recording tree:

df -h /var/bigbluebutton
sudo du -sh /var/bigbluebutton/recording /var/bigbluebutton/published

Do not expect disk usage to drop by exactly the playback size shown to users. Raw media, processing files, published presentation files, logs, and temporary data are stored separately, and cleanup timing may differ between categories.

Terminal showing the bbb-record list command with published BigBlueButton recordings
Use bbb-record listing commands after cleanup to confirm that the expected recordings remain available.

How to choose a retention period

A useful retention value comes from three constraints: user expectations, recovery needs, and available storage. Short retention lowers storage pressure but gives administrators less time to discover processing defects or rebuild recordings. Long retention increases recovery flexibility but requires more disk and may conflict with data-minimization requirements.

  • Keep playback, minimize raw storage: tune published_days and leave published recordings intact.
  • Enforce a hard playback expiration: use the separate daily cleanup script with a clearly documented MAXAGE.
  • Need per-course or per-customer rules: put retention decisions in the LMS or application layer and use BigBlueButton’s API deliberately, rather than forcing one server-wide age onto every recording.
  • Need rebuild flexibility: keep raw data longer than the minimum and make sure backup capacity matches that choice.

Common mistakes to avoid

The first common mistake is assuming that published_days deletes published recordings. It only governs raw data associated with published recordings. The second is using rm -rf against BigBlueButton recording directories as the primary retention mechanism. That bypasses the recording tool’s knowledge of meeting IDs and can leave inconsistent state.

Another mistake is setting retention aggressively before measuring actual growth. Capture at least several days of du and df data, then select a period that leaves enough headroom for unusually busy weeks. BigBlueButton’s production requirements themselves call for substantial recording storage, which is a reminder that cleanup should be designed as capacity management, not as an emergency reaction after a filesystem is nearly full.

Final checklist

  • Confirm the installed BigBlueButton version with bbb-conf --check.
  • Decide whether you only need raw-data cleanup or complete recording expiration.
  • Measure current storage use before selecting a retention period.
  • Review old recording candidates before enabling deletion.
  • Create the daily cleanup script and make it executable.
  • Run it manually once and inspect the log.
  • Recheck bbb-record --list-recent, bbb-record --check, and disk usage.
  • Document the retention policy so users know how long playback remains available.

For most single-server BigBlueButton 3.0 installations, the lowest-maintenance design is to let the built-in daily job remove published recordings’ raw data after a recovery window, then add the documented bbb-recording-cleanup daily script only when you also need published recordings to expire. That separates two different storage decisions and makes the tradeoff explicit instead of treating every old recording file the same way.

Leave a Comment

7 Best WSUS Tools for Update Management and Troubleshooting

7 Best WSUS Tools for Update Management and Troubleshooting

Compare seven tools that support or complement WSUS, from Microsoft’s native console and diagnostics to third-party patch publishing and remote deployment.

Best Windows System Monitoring Tools: 6 Picks for Server Visibility

Best Windows System Monitoring Tools: 6 Picks for Server Visibility

Compare six Windows system monitoring tools for server health, application visibility, and alerting, with current notes on deployment and licensing.

7 Wake-on-LAN Tools: What’s Still Available From the 2021 List

7 Wake-on-LAN Tools: What’s Still Available From the 2021 List

Compare seven Wake-on-LAN tools by features and availability, including free utilities, network-admin suites, and 2021 picks that have since been retired.

9 Best Ping Tools for Testing Latency and Scanning a Network

9 Best Ping Tools for Testing Latency and Scanning a Network

Compare nine ping tools for quick reachability checks, subnet discovery, TCP tests, and latency monitoring, with guidance on which one fits your network task.

Best TFTP Servers for Windows, Linux, and macOS

Best TFTP Servers for Windows, Linux, and macOS

Compare the best TFTP servers for Windows, Linux, and macOS, including SolarWinds, Tftpd64, tftpd-hpa, atftpd, haneWIN, and dnsmasq.

5 Best Microsoft Access Alternatives for Desktop and Web Databases

5 Best Microsoft Access Alternatives for Desktop and Web Databases

Compare five Microsoft Access alternatives for desktop, SQLite, no-code, and browser-based database work, with strengths, limits, and best-fit use cases.

Open-Source vs. Closed-Source Monitoring Tools Compared

Open-Source vs. Closed-Source Monitoring Tools Compared

Compare open-source and closed-source monitoring tools by cost, support, customization, security, and current options including Zabbix, Nagios, PRTG, and more.

Ingress vs. Egress: What’s the Difference in Networking?

Ingress vs. Egress: What’s the Difference in Networking?

Understand how ingress and egress describe incoming and outgoing traffic, why direction depends on the network boundary, and how to monitor bandwidth and spot risky data transfers.

6 Best Free Syslog Servers to Try for Centralized Logging

6 Best Free Syslog Servers to Try for Centralized Logging

Compare six free syslog servers and collectors for Windows and Linux, including GUI tools, open-source options, search, alerting, and secure transport.

What Is IIS? Microsoft’s Windows Web Server and Alternatives

What Is IIS? Microsoft’s Windows Web Server and Alternatives

See what Microsoft IIS does, how its request pipeline and application pools work, and when Apache, NGINX, or Caddy may fit your web server needs better.