You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/usr/bin/env bash
- set -euo pipefail
-
- INPUT="$1"
- STAGING="$2"
- OUTPUT="$3"
-
- while true ; do
- echo "Attempting to move files..."
- COUNT=$(find "$INPUT" -type f | wc -l)
- if [[ $COUNT -ne 0 ]]; then
- echo "Found $COUNT files!"
- echo "Moving from input to staging..."
- mv -v "$INPUT"/* "$STAGING/" || true
- echo "Atomically moving from staging to output..."
- mv -v "$STAGING"/* "$OUTPUT/" || true
- fi
- sleep 5
- done
|