#!/bin/bash

Using TAR to keep ownership, groups, permissions and other metadata! Run as root.
With these examples archive.tar will be stored under working directory.

# To Backup just One Container
cd /srv/containers
sudo tar -I 'lz4 -1 -c -' -cpf /home/administrador/CONT.tar.lz4 /srv/containers/CONT/

# To backup everything under /srv:
sudo tar -I 'lz4 -1 -c -' -cpf archive.tar.lz4 /srv/containers/CONTAINER_NAME

# To backup everything under /home/nathandrake/my_files/omg/ and send the tar file to /home/urbancompasspony/:
sudo tar -I 'lz4 -1 -c -' -cpf /home/urbancompasspony/archive.tar -C /home/nathandrake/my_files/omg/ .

# To check if everything is ok:
sudo tar -I 'lz4 -d -c -' -twf file.tar.lz4 && echo 'backup ok' || echo 'backup quebrado'

# To restore everything that is on /home/nathandrake/archive.tar over /home/nathandrake/my_files/omg/:
sudo tar -I 'lz4 -d -c -' -xf /home/urbancompasspony/archive.tar.lz4 -C /home/urbancompasspony/my_files/omg/

TO BACKUP an entire container:
docker save urbancompasspony/razera > razera.tar

TO RESTORE entire container:
docker load < razera.tar

Then run the container with common parameters
