Skip to content
Shellbay

Databases · about 3 min · 4 steps

Nightly MariaDB backups

Backs up every MariaDB database each night, keeping a set number of days.

Runs on

  • Debian / Ubuntu: supported
  • RHEL / Fedora: supported
  • Alpine: supported

Before you start

  • Run the MariaDB (secured) workflow first.

What it changes on your server

  • Installs /usr/local/sbin/shellbay-mariadb-backup and runs it every night (a systemd timer, or /etc/periodic/daily on Alpine).
  • Each night it saves every database to /var/backups/shellbay/mariadb/nightly (root only) and deletes backups older than the number of days you choose.
  • Records the number of days in /etc/shellbay/mariadb-backup.conf.
  • Turning the schedule off removes it and keeps the existing backup files.

What Shellbay asks you

  1. Nightly backups

    Backups run around 2 a.m. server time. Each night's files are kept for the number of days you choose, then deleted to save disk space. Turn the switch off to stop the schedule.

    Back up every night
    On or off. Default: on
    Days to keep
    A whole number from 1 to 90. Default: 7

    Example: 7

Steps

  1. Check the database server
  2. Save the settings
  3. Set up the schedule
  4. Take the first backup and check it

Shellbay checks the server before the first step, and stops at the first step that fails.

When it's done

  • Nightly backups are saved in /var/backups/shellbay/mariadb/nightly and kept for ‹days to keep› days. The log is /var/log/shellbay-mariadb-backup.log.
  • Copy them off the server regularly (for example with the restic workflow): backups on the same disk don't survive losing the server.