A robust Bash utility designed for managing 7 Days to Die save games on Linux. This tool offers an interactive menu for ease of use and powerful command-line arguments for automation.
Inspired by a Powershell backup script from LewsTherinSedai, this Linux port is optimized for performance and reliability on distributions like Fedora, Ubuntu, and Debian.
- Multi-Format Support: Defaults to
.tar.gzfor native Linux efficiency, with optional.zipsupport for cross-platform compatibility, and.tarfor maximum speed (no compression). - Safety First: Automatically triggers a PreRestore snapshot before overwriting any data during a restore operation, ensuring you never lose progress accidentally.
- Flexible Scope: Backup a specific "default" save game or the entire Saves directory.
- Interactive CLI: Color-coded, menu-driven interface for easy manual management.
- Automation Ready: Full support for command-line arguments, making it perfect for
cronjobs or systemd timers. - Smart Structure: Archives are created with clean, relative paths to avoid absolute path clutter.
The script requires Bash 4.0+ and standard Linux utilities. Most are pre-installed on major distributions.
- tar: For default compression (usually pre-installed).
- util-linux: Provides
getoptfor advanced argument parsing. - coreutils: Provides
realpath. - zip / unzip: Required only if you use the
.zipformat.
Fedora:
sudo dnf install tar util-linux coreutils zip unzipUbuntu/Debian:
sudo apt update
sudo apt install tar util-linux coreutils zip unzip- Clone or Download this repository.
- Make the script executable:
chmod +x backup7D2D.sh
Open backup7D2D.sh in your preferred text editor to customize the paths if your setup differs from the defaults:
# Standard paths for Steam on Linux
SAVE_ROOT="$HOME/.local/share/7DaysToDie/Saves"
# The specific world/save you play most often
DEFAULT_SAVE_NAME="Votute County"
# Where backups will be stored
BACKUP_PATH="$HOME/Documents/7d2dBackups"Simply run the script without arguments to launch the text-based UI:
./backup7D2D.shYou will be presented with a menu:
- Backup default save: Backs up the folder specified in
DEFAULT_SAVE_NAME. - Backup ALL saves: Backs up the entire
SAVE_ROOT. - Restore default save: Lists available backups for the default save and restores the selection.
- Restore ALL saves: Lists available backups for the global saves folder and restores the selection.
- Toggle Format: Switch between
.tar.gz,.zip, and.tar(uncompressed) for the current session.
Use flags to bypass the menu, ideal for scheduled backups.
| Flag (Short/Long) | Options | Description |
|---|---|---|
-h, --help |
N/A | Show help message. |
-b, --backup |
N/A | Triggers the backup action immediately. |
-r, --restore |
FILE | Triggers the restore action for the specified backup file. |
-t, --type |
Default, All |
Optional. Defaults to Default. Determines if you backup the single target save or everything. |
-f, --format |
tar.gz, zip, tar |
Optional. Defaults to tar.gz. Overrides the script default format. Use tar for no compression. |
-o, --output |
PATH | Optional. Custom output backup path. |
-s, --save-path |
PATH | Optional. Custom save root directory. |
-n, --name |
NAME | Optional. Custom default save name. |
Backup the default save (Standard):
./backup7D2D.sh --backupBackup ALL saves:
./backup7D2D.sh -b -t AllBackup default save as a ZIP file:
./backup7D2D.sh --backup --format zipBackup default save with no compression (Fastest):
./backup7D2D.sh --backup --format tarBackup to a custom directory:
./backup7D2D.sh -b -o /mnt/external_drive/7d2d_backupsBackup a specific world/save by name:
./backup7D2D.sh -b -n "MyCustomWorld"Restore a specific backup:
./backup7D2D.sh --restore ./my_backup.tar.gzWhen you choose to Restore, the script performs the following actions:
- Safety Snapshot: Immediately creates a backup of the current state of the target folder (suffixed with
_PreRestore). - Extraction: Decompresses the selected archive, overwriting files in the target directory.
This ensures that if you restore the wrong file or change your mind, your pre-restore state is safely saved in the backup folder.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full text.
- Author: fedoraBee
- Source: GitHub
- Inspiration: LewsTherinSedai's Public Repo