alt text

Idea Link to heading

Since I was running some servers containing critical data on my home network, there was a requirement to build a setup to backup the data and upload it to a remote storage. And one of the concerns was to keep the cost low to none and keep the resource usage to minimum as possible.

Plan Link to heading

There were lots of backup options including ones with more features but since my server is a low-end thin-client, I decided to build a script my self using bash. And for the remote storage it was decided to use the mega.nz as it offers 20gb of encrypted storage by default.

Process Link to heading

In the script, first it will check if the container is in the exclude list or not and then stops it. This is to ensure the backup integrity in a very crude and minimal way. Downtime per container is very short depending on the size of the data and since these are personal servers I have schedule them for early morning hours where usage is very minimal to reduce the impact. There are some error handling to check and notify me about the status of the job via gotify, a simple notification system\app. Once the backups are done container will be started and files will be compressed and encrypted. Then they will be copied to a samba share and will be uploaded to mega via its mega-cmd client. This job is getting monitored by another script and will send alerts with its status once done.

Result Link to heading

Because of the resource constraints, this setup is ideal for me. However plans are there to improve the script to enhance the error handling and reduce the downtime. Will be updating the github repo with the upgraded code and hopefully this will be helpful for anyone looking for a simple backup script. You can use my github repository mentioned here for the updated scripts and instructions.