R
Rob
Guest
We have video cameras saving footage on to a fileserver - but it's taking up about 30G/day.. so I wanted to do something to remove files older than a week or so.. All it took was throwing this command into a cron job:
This will find files under the /mnt/data/cam/2011/ (or 2012, 2013, etc..) directory that are 8 days old and remove them. You can test the command by replacing "rm -f" with "ls" to see what files it found..
Code:
/usr/bin/find /mnt/data/cam/201?/ -type f -mtime +8 -exec rm -f {} \;
This will find files under the /mnt/data/cam/2011/ (or 2012, 2013, etc..) directory that are 8 days old and remove them. You can test the command by replacing "rm -f" with "ls" to see what files it found..