Skip to content

projectcitybuild/pcb-minecraft-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup Script

Bash script that can be run on a cronjob to backup a Minecraft server.

Requirements

  • Linux
  • Server running via Pterodactyl Panel
  • Discord webhook (for notifications)
  • Duplicacy installed

Usage

Initial Setup

Generate an asymmetric key pair for encryption

openssl genrsa -aes256 -out private.pem 2048
openssl rsa -in private.pem  -pubout -out public.pem

Copy .env.example as .env and fill in the required secrets

cp .env.example .env

Initialize the repository

./backup.sh -i /my/folder/to/backup

Backup filter

To update the file include/exclude filter, modify the filters file before performing your backup.

See https://github.com/gilbertchen/duplicacy/wiki/Include-Exclude-Patterns for details.

To test what will get included/excluded, perform a backup as a dry-run.

# Print everything included/excluded
./backup.sh -d

# Print only what will be excluded
./backup.sh -d | grep 'PATTERN_EXCLUDE'

# Print only what will be included
./backup.sh -d | grep 'PATTERN_INCLUDE'

Backup

./backup.sh

To automate this with a cronjob:

0 0 * * * cd /your/path/pcb-minecraft-backup && /bin/bash ./backup.sh

Important

The cd is required because the script assumes it is being run from the git repo directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published