Backup in Linux Servers - Docker Volumes, and Databases

preview_player
Показать описание
Backup in Linux doesn't need to be complicated. I'll show you backup strategies and tools to create a reliable backup for your entire Linux server. You can use this perfectly in combination with Docker Volumes and Databases. #Duplicati #Docker #HomeLab

Follow me:

Timestamps:

00:00 - Introduction
01:05 - Backup Strategies
02:40 - Incremental Backups
04:32 - Deploy Duplicati on Portainer
09:19 - Create a simple Backup Job
12:28 - How to Backup Databases
14:57 - Database Backup Script
18:18 - Backup Database Dumps with Duplicati
19:35 - Automatically run the Script

----
All links with "*" are affiliate links.
Рекомендации по теме
Комментарии
Автор

SOLID videos. I've watched dozens of yours. I hope your channel explodes!

belaircomputerguyllc
Автор

Thank you Christian for going the extra step with the Databases. This kind of content is really missing on YT as most tutorials cover the "easy" stuff.

albert
Автор

I was literally today contemplating how to backup my databases on my home server. Thank you for posting - your timing was perfect as was the info.

myr
Автор

You earned a new subscriber. Your videos are better than a lot of tech guys out there. Respect from India🙏

thewestindianboy
Автор

It amazing how much my home network project with docker, docker compose and all the containers I run line up with the videos you put out. Sometimes I get the feeling you are seeing my project notes. Just this week I started fiddling with backups and what do you know a new TDL video to explain exactly what I need to now.
Keep up the awesome work man. Your videos really help me enjoy the process of creating and managing my own setup.

MrBoydheeres
Автор

Database backups! I’ve been meaning to dive into this, thanks for the overview of how you’re managing this!

partretropartnostalgia
Автор

The db backup script blows my mind! Thanks!
Please more videos ámbito db restore!

JeanFrancoCaringi
Автор

This video is great! I didn't know that I can back up docker volumes witt Duplicati. Thank you Christian!

matthaeusdoerksen
Автор

As a Newbie I am able to understand and follow your explanations. Even though it's hard for me to deeply understand what's going on, I can still pickup on things to learn next. I would love to see a Linux survivor's guide by Christian TDL. I'd watch a nice, long, in-depth Linux introduction course by this guy.

stevendonaldson
Автор

Just wow. What a video. Didn't know of Duplicati. This is just what I was looking for. Thanks!

LarsEjaas
Автор

A lot of thanks go to you for presenting this complete backup solution!

alimohammadi
Автор

Thanks for the demistification of backups. Great video.

HEWfunkingKNEWit
Автор

You’re doing great work man! Your videos are so easy to follow and helpful! Thanks for all your efforts on this channel :)

walking_on_earth
Автор

So useful, thank you so much Christian! - The DB backup script, I can just read it.. but couldn't have written it.

yachalupson
Автор

Thank you Christian for this awesome video, it is really helpful!

With the help of your tutorial, I am now able to backup the docker containers for my Zabbix installation. Nevertheless, during the setup process of Duplicati and your db backup script I had to overcome two hurdles and I would like to share how I solved the different challenges.

The Zabbix installation has four different containers and the images are called "zabbix/zabbix-agent", "zabbix/zabbix-server-mysql" and "zabbix/zabbix-java-gateway". In addition to these four containers, I run a mariadb container for the db. When the first line of your backup script (docker ps ....) is executed, not only the mariadb docker is in the output, but also "zabbix-web-nginx-mysql" and "zabbix-server-mysql", which both do not contain a database. So I had to adapt this line to the following:

CONTAINER=$(docker ps --format '{{.Names}}:{{.Image}}' | grep 'mariadb' | cut -d":" -f1)

With this, the output of the docker ps command is only the mariadb container.

For the execution of this script, I use a cronjob.



I also tested the restore of the mysql dump and since it is not explained in detail how the mysql dump is restored, here's how I do it:

- Recreate the docker container with cli command or docker-compose file.
- Mount the Backup directory from the backup script in the mariadb container (e.g.
- Go to the backup directory and unzip the dump file: cd /appdata/mariadb/backup && sudo gunzip name-of-dump-file.sql.gz
- Connect to mariadb docker console: docker exec -it -u 0 name-of-mariadb-docker /bin/bash
- Restore the mysql db with following command: mysql --user username-of-database --password -p name-of-database < /backup/name-of-dump-file.sql

After that, I restart all Zabbix containers and also the mariadb container and everything is fine.

Once again, thank your for this awesome tutorial!

maginos
Автор

really love your channel Christian! thank you

lukestagg
Автор

very clear and well explained, thanks for taking your time making this video.

arielalejandro
Автор

Hi Christian, will you please consider a companion video on restoring these database types (mariadb, mysql, sqlite) from the compressed file? There are different methods out there, but it would be great to hear your preference.

randallroach
Автор

From the doc:
> The Duplicati project was inspired by Duplicity and had similar functionality until 2008

I believe duplicati is an Italian word and you spell du-plee-ka-tee

qiuyue
Автор

I seem to have a problem with your script for restoring containers from backups. I used the scp command to send a backup of the bitwarden file to the path on my other server, and then executed the following command,

docker run --rm --volumes-from bitwarden -v $(pwd):/backup busybox bash -c "cd /data && tar xvf --strip 1"

which reports an error,
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled

and I don't know how to fix it I don't know how to fix it, can you help me to see how to deal with it?

guguge