Skip to content

Commit

Permalink
nc-backup: parallel compression
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jan 17, 2019
1 parent 2419e57 commit 84ac075
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions bin/ncp/BACKUPS/nc-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

install()
{
apt-get update
apt-get install -y --no-install-recommends pigz

cat > /usr/local/bin/ncp-backup <<'EOF'
#!/bin/bash
set -eE
Expand Down Expand Up @@ -67,9 +70,9 @@ mysqldump -u root --single-transaction nextcloud > "$dbbackup"
# files
echo "backup files..."
[[ "$includedata" == "yes" ]] && data="$(basename "$datadir")"
[[ "$compress" == "yes" ]] && z=z
[[ "$compress" == "yes" ]] && compress_arg="-I pigz"
mkdir -p "$destdir"
tar -c${z}f "$destfile" \
tar $compress_arg -cf "$destfile" \
\
"$dbbackup" \
\
Expand Down
4 changes: 2 additions & 2 deletions bin/ncp/BACKUPS/nc-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ rm -rf "$TMPDIR" && mkdir -p "$TMPDIR"
# EXTRACT FILES
echo "extracting backup file $BACKUPFILE..."
[[ "$BACKUPFILE" =~ ".tar.gz" ]] && z=z
tar -x${z}f "$BACKUPFILE" -C "$TMPDIR" || exit 1
[[ "$BACKUPFILE" =~ ".tar.gz" ]] && compress_arg="-I pigz"
tar $compress_arg -xf "$BACKUPFILE" -C "$TMPDIR" || exit 1
## SANITY CHECKS
[[ -d "$TMPDIR"/nextcloud ]] && [[ -f "$( ls "$TMPDIR"/nextcloud-sqlbkp_*.bak 2>/dev/null )" ]] || {
Expand Down
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

[v1.3.10](https://github.com/nextcloud/nextcloudpi/commit/b9fd429) (2019-01-15) nc-backup: compress in place and exclude previews folder
[v1.3.11](https://github.com/nextcloud/nextcloudpi/commit/418aa74) (2019-01-16) nc-backup: parallel compression

[v1.3.9](https://github.com/nextcloud/nextcloudpi/commit/0b8252b) (2019-01-15) build: add exfat utils for external storage
[v1.3.10](https://github.com/nextcloud/nextcloudpi/commit/2419e57) (2019-01-15) nc-backup: compress in place and exclude previews folder

[v1.3.9 ](https://github.com/nextcloud/nextcloudpi/commit/0b8252b) (2019-01-15) build: add exfat utils for external storage

[v1.3.8 ](https://github.com/nextcloud/nextcloudpi/commit/193d89b) (2019-01-14) nc-datadir: fix fail2ban logpath

Expand Down

0 comments on commit 84ac075

Please sign in to comment.