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.
 
 

24 lines
438 B

  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. INCOMING="${INCOMING:-/data/incoming/}"
  4. UPLOAD_QUEUE="${UPLOAD_QUEUE:-/data/upload-queue/}"
  5. # find every .warc.gz in the rsync directory
  6. find "${INCOMING}" -type f -not -name ".*"\
  7. | while read filename
  8. do
  9. # skip partial uploads
  10. if [[ $filename =~ rsync-tmp ]]
  11. then
  12. continue
  13. fi
  14. echo "Moving ${filename}"
  15. mkdir -vp "${UPLOAD_QUEUE}"
  16. mv -v "${filename}" "${UPLOAD_QUEUE}/"
  17. done