Skip to content

Script for automatic download/rotation on multiple local drives pterodactyl backups

Notifications You must be signed in to change notification settings

tony-ist/rotate-pterodactyl-backups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rotate Pterodactyl Backups

This script uses Pterodactyl API to make backups of servers with specific tag in description, downloads backups to two different physical drives and calls external rotation script. There is also restore backup script in this repo.

RFC

Usage

Warning

Backup and restore procedures require you to set 2 or more backup slots for your pterodactyl server. Backup and restore always delete oldest backup in your server and then create new one so that you do not hit the backup limit. Restore deletes oldest backup because it needs to create one dummy backup. Currently /api/client/servers/<id>/backups/<id>/restore API endpoint is not intended for use other than via browser client. So instead it creates dummy backup, copies selected backup in its place, and then you manually press restore button in pterodactyl.

Backup

copy .env.example .env
pipenv shell
pipenv install
  • Edit the .env file.
  • Set up a cron job to run main.py daily as a root. Rotations happen daily, and it's not configurable for now.

Example root cron job:

0 6 * * * PYTHONPATH=/opt/rotate-pterodactyl-backups /root/.local/share/virtualenvs/rotate-pterodactyl-backups-PWOIOIqs/bin/python /opt/rotate-pterodactyl-backups/src/main.py

Restore

  • Run restore.py script. You can then choose the server to restore backups for and backup which you want to restore.
  • After script is done, head to the pterodactyl panel and restore backup with the provided name.

TODO

  • Read rotate-backups.ini configuration file via rotate-backups API

About

Script for automatic download/rotation on multiple local drives pterodactyl backups

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages