Merge pull request from danielhoherd/improve-backup

Ignore backup archives. Use 'find | xargs' to handle missing files.
This commit is contained in:
evilsocket 2019-11-10 13:11:30 +01:00 committed by GitHub
commit d7e1c59709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

2
.gitignore vendored

@ -15,3 +15,5 @@ output-pwnagotchi
build
dist
pwnagotchi.egg-info
*backup*.tgz
*backup*.gz

@ -2,7 +2,7 @@
# name of the ethernet gadget interface on the host
UNIT_HOSTNAME=${1:-10.0.0.2}
# output backup zip file
# output backup tgz file
OUTPUT=${2:-pwnagotchi-backup.tgz}
# username to use for ssh
USERNAME=${3:-pi}
@ -26,4 +26,4 @@ ping -c 1 "${UNIT_HOSTNAME}" >/dev/null || {
}
echo "@ backing up $UNIT_HOSTNAME to $OUTPUT ..."
ssh "${USERNAME}@${UNIT_HOSTNAME}" "sudo tar cv ${FILES_TO_BACKUP[@]}" | gzip -9 > "$OUTPUT"
ssh "${USERNAME}@${UNIT_HOSTNAME}" "sudo find ${FILES_TO_BACKUP[@]} -print0 | xargs -0 sudo tar cv" | gzip -9 > "$OUTPUT"

@ -2,7 +2,7 @@
# name of the ethernet gadget interface on the host
UNIT_HOSTNAME=${1:-10.0.0.2}
# output backup zip file
# output backup tgz file
BACKUP=${2:-pwnagotchi-backup.tgz}
# username to use for ssh
USERNAME=${3:-pi}