๐Ÿ“ฆBackup

Nextcloud back with restic

triangle-exclamation

These are basic steps to perform backup nextcloud with restic

From nextcloud docsarrow-up-right, there 2 location that need to be backed up. There are

  • Nextcloud data directory

  • Postgresql database dumps For these, we need to create 2 restic repos to maintain.

Initialize restic repos

NEXTCLOUD_DATA_RESTIC_REPO="/media/disk1/nextcloud_data_restic_repo"
NEXTCLOUD_PG_RESTIC_REPO="/media/disk1/nextcloud_pg_restic_repo"
BACKUP_DIR="/media/disk2/nextcloud"
RESTIC_PASSWORD_FILE="/home/veerendra/pass.txt"
  • NEXTCLOUD_DATA_RESTIC_REPO is the restic repo for nextcloud data directory backup

  • NEXTCLOUD_PG_RESTIC_REPO is the restic repo for postgresql database dumps backup

  • BACKUP_DIR backup directory of nextcloud data

  • RESTIC_PASSWORD_FILE Restic repo password file for both repos

Init the repos

$ restic -r $NEXTCLOUD_DATA_RESTIC_REPO init
$ restic -r $NEXTCLOUD_PG_RESTIC_REPO init

Set maintenance mode ON

Run restic backups

Backup nextcloud data

Backup postgresql database dump

Unset maintenance mode

This shell scriptarrow-up-right automates above steps with metrics

Last updated