Skip to content

Commit

Permalink
nc-restore: restore to a btrfs subvolume
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jan 6, 2018
1 parent 3beff63 commit 459fe39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 7 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@

[v0.44.6](https://github.com/nextcloud/nextcloudpi/commit/1b20f3d) (2018-01-05) nc-restore: restore compressed backups
[v0.44.8](https://github.com/nextcloud/nextcloudpi/commit/e6fe1b6) (2018-01-06) nc-restore: restore to a btrfs subvolume

[v0.44.5](https://github.com/nextcloud/nextcloudpi/commit/10fd204) (2018-01-04) nc-backup: compress backups and refactoring
[v0.44.7 ](https://github.com/nextcloud/nextcloudpi/commit/50513f6) (2018-01-06) nc-backup: make binary work standalone

[v0.44.6](https://github.com/nextcloud/nextcloudpi/commit/a4f27a2) (2018-01-05) nc-restore: restore compressed backups

[v0.44.5 ](https://github.com/nextcloud/nextcloudpi/commit/10fd204) (2018-01-04) nc-backup: compress backups and refactoring

[v0.44.4 ](https://github.com/nextcloud/nextcloudpi/commit/56576da) (2018-01-03) nc-restore: update redis password

[v0.44.3 ](https://github.com/nextcloud/nextcloudpi/commit/2a91f86) (2018-01-03) nc-export: protect file from read

[v0.44.2](https://github.com/nextcloud/nextcloudpi/commit/9a18925) (2018-01-01) nc-snapshot: update btrfs-snp
[v0.44.2 ](https://github.com/nextcloud/nextcloudpi/commit/9a18925) (2018-01-01) nc-snapshot: update btrfs-snp

[v0.44.1 ](https://github.com/nextcloud/nextcloudpi/commit/5a80299) (2017-12-28) nc-snapshot: use btrfs-snp

Expand Down
13 changes: 10 additions & 3 deletions etc/nextcloudpi-config.d/nc-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,18 @@ EOF

[[ -e "$DATADIR" ]] && {
echo "backing up existing $DATADIR"
mv "$DATADIR" "$DATADIR-$( date "+%m-%d-%y" )"
mv "$DATADIR" "$DATADIR-$( date "+%m-%d-%y" )" || return 1
}

mkdir -p "$( dirname "$DATADIR" )"
mv "$TMPDIR/$( basename "$DATADIR" )" "$DATADIR"
mkdir -p "$DATADIR"
[[ "$( stat -fc%T "$DATADIR" )" == "btrfs" ]] && {
rmdir "$DATADIR" || return 1
btrfs subvolume create "$DATADIR" || return 1
}
chown www-data:www-data "$DATADIR"
local TMPDATA="$TMPDIR/$( basename "$DATADIR" )"
mv "$TMPDATA"/* "$TMPDATA"/.[!.]* "$DATADIR" || return 1
rmdir "$TMPDATA" || return 1

sudo -u www-data php occ maintenance:mode --off

Expand Down

0 comments on commit 459fe39

Please sign in to comment.