Ignore backup archives. Use 'find | xargs' to handle missing files. Correct file type in comments.

Signed-off-by: Daniel Hoherd <daniel.hoherd@gmail.com>
This commit is contained in:
Daniel Hoherd 2019-11-09 17:20:42 -08:00
parent 38144a7abb
commit 7ca1168fed
3 changed files with 5 additions and 3 deletions

2
.gitignore vendored
View File

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

View File

@ -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"

View File

@ -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}