Skip to content

Commit

Permalink
feat: add individual page fetch to backup
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed Nov 26, 2024
1 parent 1a758a4 commit f4f953a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
DIR=$1
echo "Using directory $DIR"
CMD=$2
PAGE_START=${3:-0}
# This script is based on https://forum.dfinity.org/t/canister-backup/11777/26
BACKUP=./backup/target/release/backup

Expand Down Expand Up @@ -55,7 +56,7 @@ fetch() {
git rev-parse HEAD > $DIR/commit.txt
dfx canister --network ic call taggr backup

PAGE=0
PAGE=$PAGE_START
while true; do
for _ in {1..10}; do
FILE="$DIR/page$PAGE.bin"
Expand All @@ -64,6 +65,6 @@ while true; do
PAGE=$((PAGE + 1))
done
wait
if [ "$(size $FILE)" == "18" ]; then break; fi
if [ "$(size $FILE)" == "18" ] || [ "$PAGE_START" -ne "0" ]; then break; fi
done

0 comments on commit f4f953a

Please sign in to comment.