Move Files Older Than X Days To Another Directory

Here’s a little script for finding files modified more than 7 days ago and moving them to another directory:

find . -type f -mtime +7 -print > /tmp/old_files.txt
cat /tmp/old_files.txt | while read line; do mv "$line" ../old_files ; done