Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-10-31 18:38:51 +0300
committernachoparker <nacho@ownyourbits.com>2017-10-31 20:42:48 +0300
commit515b73151f515febcba94f56b6dabf73d42d087f (patch)
treeb25fb18e4c4af234d1d8ea3b19fc0c3581cb45ae
parent706a48dc751d6268070bc64f4f98f80fa1faa2dc (diff)
nc-backup: check available spacev0.31.27
-rw-r--r--changelog.md6
-rw-r--r--etc/nextcloudpi-config.d/nc-backup-auto.sh9
-rw-r--r--etc/nextcloudpi-config.d/nc-backup.sh9
3 files changed, 23 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 6a8ae608..801ee15b 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,9 @@
-[v0.31.26](https://github.com/nextcloud/nextcloudpi/commit/f9c5319) (2017-10-30) build: check ncp-launcher existence for old images
+[v0.31.28](https://github.com/nextcloud/nextcloudpi/commit/57f516e) (2017-10-31) nc-backup: check available sapace
+
+[v0.31.27](https://github.com/nextcloud/nextcloudpi/commit/2eda5f8) (2017-10-31) nc-restore: restore db password before occ command
+
+[v0.31.26](https://github.com/nextcloud/nextcloudpi/commit/f5ac88d) (2017-10-30) build: check ncp-launcher existence for old images
[v0.31.25](https://github.com/nextcloud/nextcloudpi/commit/4d283f9) (2017-10-29) letsencrypt: remove workaround. fixed upstream
diff --git a/etc/nextcloudpi-config.d/nc-backup-auto.sh b/etc/nextcloudpi-config.d/nc-backup-auto.sh
index e2c3b91b..a53d36f1 100644
--- a/etc/nextcloudpi-config.d/nc-backup-auto.sh
+++ b/etc/nextcloudpi-config.d/nc-backup-auto.sh
@@ -57,6 +57,15 @@ DATADIR=\$( cd $BASEDIR/nextcloud; sudo -u www-data php occ config:system:get da
return 1;
}
+echo -e "check free space..."
+local SIZE=\$( du -s "\$DATADIR" | awk '{ print \$1 }' )
+local FREE=\$( df "\$DATADIR" | tail -1 | awk '{ print \$4 }' )
+
+[ \$SIZE -ge \$FREE ] && {
+ echo -e "free space check failed. Need \$( du -sh "\$DATADIR" | awk '{ print \$1 }' )";
+ return 1;
+}
+
cd $BASEDIR/nextcloud
sudo -u www-data php occ maintenance:mode --on
diff --git a/etc/nextcloudpi-config.d/nc-backup.sh b/etc/nextcloudpi-config.d/nc-backup.sh
index af940ec8..9cc86dd9 100644
--- a/etc/nextcloudpi-config.d/nc-backup.sh
+++ b/etc/nextcloudpi-config.d/nc-backup.sh
@@ -31,6 +31,15 @@ configure()
return 1;
}
+ echo -e "check free space..."
+ local SIZE=$( du -s "$DATADIR" | awk '{ print $1 }' )
+ local FREE=$( df "$DATADIR" | tail -1 | awk '{ print $4 }' )
+
+ [ $SIZE -ge $FREE ] && {
+ echo -e "free space check failed. Need $( du -sh "$DATADIR" | awk '{ print $1 }' )";
+ return 1;
+ }
+
sudo -u www-data php "$BASEDIR"/nextcloud/occ maintenance:mode --on
# delete older backups