Schedule backups

Take a backup every night with cron or a systemd timer.

Take a backup every night without stepping in, with cron or a systemd timer.

Requirements

  • Access to teseladb admin on a node of the cluster.
  • Space for several backups and a place outside the cluster to take them.

One backup a night with cron

30 2 * * * teseladb admin --dbpath /var/lib/teseladb backup --at now --out /backups/$(date +\%F)

Take them elsewhere

Copy each folder somewhere else, for example an object store, once the command finishes.

Check

Every morning there is a new folder with the date of the day and its manifest.bson.

Common problems

  • The backup is not taken because the command cannot find the credentials. In cron, give the command --dbpath or the TLS files.

See also