We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b60a3e6 commit 6e4c42bCopy full SHA for 6e4c42b
share/github-backup-utils/ghe-prune-snapshots
@@ -24,7 +24,7 @@ prune_snapshot() {
24
#if [ ! -f "$GHE_DATA_DIR/in-progress" ] && [ ! -f "$GHE_DATA_DIR/in-progress-restore" ]; then
25
# Check for backup or restore in-progress file
26
inprogress_file=$(find $GHE_DATA_DIR -maxdepth 1 -type f \( -name "in-progress" -o -name "in-progress-restore" \) -print -quit)
27
-if [[ "$CALLING_SCRIPT" == "ghe-backup" ]]; then
+if [[ "$CALLING_SCRIPT" == "ghe-backup" ]] || [ -z "$inprogress_file" ]; then
28
# First prune all incomplete / failed snapshot directories
29
prune_dirs="$(ls -1 "$GHE_DATA_DIR"/[0-9]*/incomplete 2>/dev/null || true)"
30
prune_num=$(echo "$prune_dirs" | grep -v '^$' | wc -l)
0 commit comments