Scripts to help backing up Docker Volumes and Images from VPS (usually Cloud) to other systems (usually local)
Go to file
2024-06-03 11:52:34 +02:00
scripts update tar to keep permissions 2024-06-03 11:52:34 +02:00
.env.sample update scripts, readme, gitignore and sample 2023-12-14 16:50:12 +01:00
.gitignore update scripts, readme, gitignore and sample 2023-12-14 16:50:12 +01:00
LICENSE Initial commit 2023-12-14 14:17:15 +01:00
README.md update scripts, readme, gitignore and sample 2023-12-14 16:50:12 +01:00

docker-stack-backupper

Overview

This toolkit comprises a set of Bash scripts designed to facilitate the backup and restoration of server files and Docker containers. The scripts are built to interact with a remote server, create backups of specified directories and running Docker containers, and retrieve these backups to a local machine.

Prerequisites

  • Bash
  • Docker (for Docker-related operations)
  • Access to a remote server with SSH
  • Sudo privileges on the machine where the scripts are run

Configuration

Copy the .env.sample into .env and add your own values

Scripts Description

  1. 01_copy_to_remote.sh

Copies specified files or directories to a remote server.

  1. 02_tar_folders.sh

Creates tar.gz backups of each folder in a specified directory and changes the ownership to a user defined in .env.

  1. 03_export_running_docker_images.sh

Exports all currently running Docker container images as tar.gz files.

  1. 04_copy_backups_local.sh

Retrieves tar.gz backups from the remote server to the local machine.

Usage

Run the scripts in order.

01_copy_to_remote.sh and 04_copy_backups_local.sh are to be run on your local machine (copy to, copy from)

02_tar_folders.sh and 03_export_running_docker_images.sh are to be run on the machine that is being backed up (backup data, backup images)

Contribution

Contributions to this project are welcome. Please follow the standard Git workflow - fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Made by me - CarlosSousa.tech