A simple backup script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

1.6 KiB


As the name suggests, this is a simple backup script written in bash.

This script came up as a result of rewriting a few backup scripts that did their job yet shared like 90% of their code. The original scripts were very hasty, so I tried to remade them into something a little more presentable.

At this time this script is capable of dealing with backing up regular files/directories and PostgreSQL databases. It has a separate Docker volume backup option, but it's been mainly made to separate those from configuration files.

This script is meant to be periodically run with cron/systemd timers. It comes with example systemd units/timers made to do just that.

backup.sh: a simple backup script.

    backup.sh [flags]

-a | --all: run the default set of backups (configs and Docker as of now)
-p | --postgres: run the backups on PostgreSQL databases
-d | --docker: run the backups on Docker volumes
-c | --configs: run the backups on the files specified in /etc/backups.conf
--no-cleanup: don't cleanup after the backup has finished
Configuration options

The configuration file is located at /etc/backups.conf. It has to be a valid bash script, as it's sourced at the program start.

For the available options see the example config file.


This script is not supposed to send backups to S3/Backblaze B2/etc. It assumes the tarballs are then copied to some other location with other tools (this may be rsync or whatever you like). The author themselves simply uses pscp for that.