Skip to content

Backups

Austin Nunn edited this page Nov 8, 2026 · 1 revision

Backups

Your channels took real work: lists, station configs, schedules, followed folders. The videos themselves are safe on your NAS, since the wrapper never changes them. But the wrapper's own data lives in ~/fieldstation42/data on the server's disk. If that disk dies, it's gone.

The repo has a backup script for this: extras/backup/fs42-backup.sh. It runs once a night and keeps two weeks of backups.

What it saves

Everything in ~/fieldstation42: the compose file, .env, any scripts you keep there, and all of data/. That includes the station configs, the schedule database, your lists (as links), followed folders, settings, and the dashboard password.

It skips two things that rebuild themselves:

  • data/catalog/media-links, the pool. The sync service makes it again.
  • data/crt, the copy a remote player pulls. It's made again on the next sync.

A backup is usually small, around 15 to 20 MB.

Why it works the way it does

  • It makes a .tar.gz file instead of copying folders. Most NAS shares can't store symlinks, and your lists are made of symlinks. Inside a tar file, they're kept exactly.
  • It copies the schedule database safely. The database is in use all the time. The script uses SQLite's own backup feature, so the copy is never half-written.
  • It reads two files through the container. The wrapper saves the Sources list and the Emby/Jellyfin cache so only root can read them. The script asks the container for them instead of needing root.

Setting it up

  1. Make sure the backup folder exists and you can write to it. A NAS share mounted on the server is a good spot, since it's off the server's disk. These steps use /mnt/backups.

  2. Download the script next to your compose file and make it runnable:

cd ~/fieldstation42
curl -fsSLO https://raw.githubusercontent.com/austincnunn/station-wrapper-43/main/extras/backup/fs42-backup.sh
chmod +x fs42-backup.sh
  1. Open it and change the settings at the top:
Setting Meaning
SRC Your install folder, like /home/tv/fieldstation42
DEST Where backups go, like /mnt/backups/fieldstation42
KEEP How many to keep (14 is two weeks)
CONTAINER The wrapper container's name
DEST_MOUNT Optional. If your backup folder is on a share, put its mount point here (like /mnt/backups). The script then stops with an error if the share isn't mounted, instead of filling up the server's own disk.
  1. Run it once by hand:
./fs42-backup.sh

It should print a line like 2026-01-15 02:30:04 ok /mnt/backups/fieldstation42/fs42-2026-01-15.tar.gz 16M.

  1. Run it every night. Open your crontab:
crontab -e

Add this line. It runs the backup at 2:30 am and keeps a log:

30 2 * * * /home/tv/fieldstation42/fs42-backup.sh >> /home/tv/fieldstation42-backup.log 2>&1

Your user needs to be able to run docker without sudo (be in the docker group). The script doesn't need root.

Checking on it

tail /home/tv/fieldstation42-backup.log
ls -l /mnt/backups/fieldstation42/

Restoring

Use this to bring a server back, or to move everything to a new one. Set up Docker and the media mount first, as in Server Setup steps 1 and 2.

  1. Stop the wrapper if it's running:
cd ~/fieldstation42 && docker compose down
  1. Unpack the newest backup into the install folder:
mkdir -p ~/fieldstation42
tar -xzpf /mnt/backups/fieldstation42/fs42-2026-01-15.tar.gz -C ~/fieldstation42
  1. Start it again:
cd ~/fieldstation42 && docker compose up -d

Your channels come back with their schedules. The pool fills itself in again over the next hour or so.

One thing to know

The backup holds .env, which has your Emby or Jellyfin key. Anyone who can read the backup folder can read that key. Keep the backups somewhere only you can get to.

Clone this wiki locally