A Python script designed for Windows users to create efficient, automated, versioned, and rotated backups of a virtual media library structure built with symbolic links.
This tool is the perfect solution for managing media collections from read-only sources, such as a cloud drive mounted with rclone or a Debrid service mounted with Zurg.
- External configuration via a user-editable
config.inifile. - Interactive setup wizard for initial configuration on first run.
- Automatic UAC prompt to ensure necessary Administrator privileges.
- True symlink-aware backups using
robocopy /SLand the TAR archive format. - Automated filename versioning to prevent overwriting same-day backups.
- Configurable backup rotation based on file modification time.
- Pre-run validation of all required paths and executables.
Because the symlink library resides on a standard writable drive, all media server features work out-of-the-box. This includes automatic subtitle downloading from Plex/Emby, local metadata saving by Jellyfin, and easy management of custom artwork and .nfo files directly within your library folders—no complex 'sidecar' directory configurations required."
This project uses a symbolic link structure pointing to a persistent virtual drive path (e.g., Z:...) instead of generating .strm files with direct HTTP links. This architectural choice provides two major benefits:
Backup Longevity: Symlinks point to a path that never expires. A backup of your library structure will remain valid indefinitely, unlike backups of .strm files containing temporary Debrid links that expire within hours or days.
API Efficiency: API calls to the Debrid service are only made on-demand at the moment of playback by the mounting tool (rclone/Zurg). Your library does not require a constantly running service to poll and refresh expiring links, drastically reducing API usage.
- OS: Windows 10 / 11.
- Python: Python 3.8+ installed. It is crucial to check the "Add Python to PATH" option during installation.
- 7-Zip: Required by the
backup.pyscript. The script defaults to the standard installation path (C:\Program Files\7-Zip\7z.exe), but this can be changed inconfig.ini. - tar: Required by the
restore.pyscript.tar.exeis included by default in modern Windows 10/11 and should be available in the system's PATH. - A Mounted Virtual Drive: An active media source, like a drive mounted with
rcloneorZurg, is needed for the restored symlinks to be functional. - (Pre-Setup) A Symlink Library: This script suite manages an existing symlink library. You need to create this structure first using a tool like FileBot or TinyMediaManager.
- (Recommended) Developer Mode: For the most reliable symbolic link creation on Windows, it is highly recommended to enable Developer Mode in the Windows Settings. While running scripts with Administrator privileges often suffices, Developer Mode grants the necessary permissions to create symlinks even to non-elevated processes, preventing many common permission errors with other tools.
- Download the
backup.pyscript and place it in a permanent folder. - Double-click
backup.py. - The script will detect that it's the first run and launch a setup wizard.
- Answer the questions to provide your required paths.
- A
config.inifile will be created, and the first backup will run. All future runs will be automatic.
- Double-click
restore.py. - The script will ask for Administrator permission (UAC prompt). Click "Yes".
- A file selection window will open. Choose the
.tarbackup file you wish to restore. - A folder selection window will open. Choose the destination folder for the restore.
- The script will then extract the backup. For the restored links to work, ensure your virtual drive (e.g.,
Z:) is active.
This tool is intended for use with legally owned or accessed media. The user is solely responsible for ensuring they comply with all applicable copyright laws.