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.

26 lines
556 B

  1. #!/usr/bin/env sh
  2. if [ $# != 3 ]; then
  3. echo "usage: $0 <cache-fs> <base-pool> <days-old>"
  4. exit 1
  5. fi
  6. CACHEFS="${1}"
  7. BASEPOOL="${2}"
  8. DAYS_OLD=${3}
  9. find "${CACHEFS}" -type f -atime +${DAYS_OLD} -printf '%P\n' | \
  10. rsync \
  11. --files-from=- \
  12. --archive \
  13. --acls \
  14. --xattrs \
  15. --atimes \
  16. --hard-links \
  17. --one-file-system \
  18. --quiet \
  19. --preallocate \
  20. --remove-source-files \
  21. --log-file=/tmp/mergerfs-cache-rsync.log \
  22. "${CACHEFS}/" \
  23. "${BASEPOOL}/"