Skip to content

Commit

Permalink
Ignore backup archives. Use 'find | xargs' to handle missing files. C…
Browse files Browse the repository at this point in the history
…orrect file type in comments.

Signed-off-by: Daniel Hoherd <daniel.hoherd@gmail.com>
  • Loading branch information
danielhoherd committed Nov 10, 2019
1 parent 38144a7 commit 7ca1168
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ output-pwnagotchi
build
dist
pwnagotchi.egg-info
*backup*.tgz
*backup*.gz
4 changes: 2 additions & 2 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 changes: 1 addition & 1 deletion scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 7ca1168

Please sign in to comment.