#!/usr/bin/env bash if [ -d resources/test-data/file-backups/ ]; then rm -r resources/test-data/file-backups/ fi mkdir -p resources/test-data/file-backups cd resources/test-data/file-backups/ || exit # Test files too old mkdir files-too-old cd files-too-old || exit touch -d "5 days ago" file1 touch -d "4 days ago" file2 touch -d "3 days ago" file3 # Test files too small cd .. || exit mkdir files-too-small cd files-too-small || exit fallocate -l 512 file1 fallocate -l 256 file2 # Test no matching files cd .. || exit mkdir no-matching cd no-matching || exit touch abc touch def touch ghi # Test only file large enough too old cd .. || exit mkdir large-enough-too-old cd large-enough-too-old || exit fallocate -l 1024 file1 touch -d "5 days ago" file1 touch -d "3 days ago" file2 touch -d "1 day ago" file3 # Test all files working cd .. || exit mkdir working cd working || exit fallocate -l 2048 file1 touch -d "2 days ago" file1