diff --git a/bin/ncp/BACKUPS/nc-snapshot-auto.sh b/bin/ncp/BACKUPS/nc-snapshot-auto.sh index 91d113497..4d9d5b3a7 100644 --- a/bin/ncp/BACKUPS/nc-snapshot-auto.sh +++ b/bin/ncp/BACKUPS/nc-snapshot-auto.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# NextCloudPi scheduled datadir BTRFS snapshots +# NextCloudPi scheduled datadir BTRFS snapshots # # Copyleft 2017 by Ignacio Nunez Hernanz # GPL licensed (see end of file) * Use at your own risk! @@ -17,32 +17,31 @@ install() } configure() -{ - [[ $ACTIVE != "yes" ]] && { +{ + [[ "$ACTIVE" != "yes" ]] && { rm -f /etc/cron.hourly/btrfs-snp echo "automatic snapshots disabled" return 0 } - local DATADIR MOUNTPOINT - DATADIR=$( sudo -u www-data php /var/www/nextcloud/occ config:system:get datadirectory ) || { - echo -e "Error reading data directory. Is NextCloud running and configured?"; - return 1; - } - - # file system check - MOUNTPOINT="$( stat -c "%m" "$DATADIR" )" || return 1 - [[ "$( stat -fc%T "$MOUNTPOINT" )" != "btrfs" ]] && { - echo "$MOUNTPOINT is not in a BTRFS filesystem" - return 1 - } - cat > /etc/cron.hourly/btrfs-snp <