Initial remote commit
This commit is contained in:
21
batch_restore.sh
Executable file
21
batch_restore.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Batch-restore metadata for already-extracted trees.
|
||||
# Usage: ./batch_restore.sh
|
||||
set -euo pipefail
|
||||
|
||||
DEST="/mnt/recovered/apr30"
|
||||
INPUT="orphan_roots.txt"
|
||||
JOBS=10
|
||||
|
||||
while read -r inum rest; do
|
||||
[[ -z "$inum" || "$inum" == \#* ]] && continue
|
||||
dest="${DEST}/${inum}"
|
||||
[[ -d "$dest" ]] || continue
|
||||
python3 restore_meta.py "$inum" "$dest" &
|
||||
while (( $(jobs -r | wc -l) >= JOBS )); do
|
||||
wait -n 2>/dev/null || sleep 0.2
|
||||
done
|
||||
done < "$INPUT"
|
||||
|
||||
wait
|
||||
echo "All done"
|
||||
Reference in New Issue
Block a user