Jump to content

How to backup your NextCloud data directory


FunkyBuddha

Recommended Posts

Posted

Automate and schedule your NextCloud backups using the script below.

Notes:

  • Change the path of the NextCloud and Back Directory
  • This set up assumes a docker installation
  • It stops the NextCloud instance before backing up
  • Backup uses tar with compression to a remote folder. Filenames are date stamped
  • NextCloud starts after backup

 

Bash Script:

Quote

#!/bin/bash
NEXTCLOUD_DATA_DIR="/my/path/nextcloud"
BACKUP_DIR="/srv/remotemount/my/path/bkup"
sudo docker stop nextcloud

sudo tar -czf $BACKUP_DIR/nextcloud_data_backup_$(date +%F).tar.gz $NEXTCLOUD_DATA_DIR
sudo docker start nextcloud

 

  • Thanks 1

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...