How to Auto Backup OBS Studio Scene Collection

Losing your OBS Studio scenes, sources, and configurations due to software crashes, drive failures, or accidental deletions can disrupt your streaming or recording workflow. While OBS Studio does not feature a built-in “backup on close” button, you can easily automate this process using a simple, lightweight startup script. This guide will show you how to create a custom launcher script for Windows and macOS/Linux that opens OBS Studio, waits for you to close the application, and then immediately backs up your entire scene collection folder with a unique timestamp.

Step 1: Locate Your OBS Studio Scene Files

Before creating the script, you need to know where OBS Studio stores your scene collection files.

Keep this path in mind, as the script will copy files directly from this folder.


Step 2: Create the Automatic Backup Script

By launching OBS Studio through a script instead of the default shortcut, the script will pause while you use OBS and execute the backup command the exact moment you close the program.

For Windows Users (Batch Script)

  1. Right-click on your desktop, select New > Text Document, and name it obs_launcher.txt.
  2. Open the file and paste the following code:
@echo off
:: Step 1: Launch OBS Studio and wait for it to close
:: Note: Adjust the path if you installed OBS in a custom directory
start /wait "" "C:\Program Files\obs-studio\bin\64bit\obs64.exe"

:: Step 2: Create a timestamp for the backup folder (YYYY-MM-DD_HH-MM)
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set "TIMESTAMP=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%_%datetime:~8,2%-%datetime:~10,2%"

:: Step 3: Define the backup destination directory
set "BACKUP_DIR=%USERPROFILE%\Documents\OBS_Scene_Backups\Backup_%TIMESTAMP%"

:: Step 4: Copy the scene files
xcopy "%APPDATA%\obs-studio\basic\scenes\*" "%BACKUP_DIR%\" /E /I /Y

echo Backup completed successfully at %TIMESTAMP%
  1. Save the file, then rename the file extension from .txt to .bat (e.g., OBS_Launcher.bat).

For macOS and Linux Users (Shell Script)

  1. Open your terminal.
  2. Create a script file by typing: nano obs_launcher.sh
  3. Paste the following code:
#!/bin/bash

# Step 1: Launch OBS and wait for it to exit
# (On macOS, use open -W. On Linux, just run obs)
if [[ "$OSTYPE" == "darwin"* ]]; then
    open -W -a "OBS"
else
    obs
fi

# Step 2: Generate timestamp
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")

# Step 3: Define source and backup destination paths
if [[ "$OSTYPE" == "darwin"* ]]; then
    SOURCE_DIR="$HOME/Library/Application Support/obs-studio/basic/scenes/"
else
    SOURCE_DIR="$HOME/.config/obs-studio/basic/scenes/"
fi

BACKUP_DIR="$HOME/Documents/OBS_Scene_Backups/Backup_$TIMESTAMP"

# Step 4: Create backup directory and copy files
mkdir -p "$BACKUP_DIR"
cp -R "$SOURCE_DIR" "$BACKUP_DIR"

echo "OBS scenes backed up to $BACKUP_DIR"
  1. Save the file (Ctrl + O, then Ctrl + X in nano).
  2. Make the script executable by running: chmod +x obs_launcher.sh

Step 3: Use Your New Launcher

To make this process seamless, you should use this script as your primary way to launch OBS Studio.

  1. Move the Script: Move your completed script file to a safe folder, such as your Documents folder.
  2. Create a Desktop Shortcut (Windows): Right-click your .bat file, select Show more options > Create shortcut, and drag that shortcut to your desktop.
  3. Change the Shortcut Icon (Optional): Right-click the new shortcut, select Properties, click Change Icon, navigate to C:\Program Files\obs-studio\bin\64bit\obs64.exe, and select the official OBS icon.
  4. Launch: Double-click your new shortcut to open OBS.

When you finish your stream or recording session and close OBS Studio, a command window will briefly appear, copy your current scene collection to your Documents folder under OBS_Scene_Backups, and close automatically.