Bash - Delete files older than

Search for files, and automatically remove them

#!/bin/bash

find /home/files/* -mmin +[ minutes ] -exec rm {} \;

Find files older than 12 hours, and remove them

#!/bin/bash

find /home/files/* -mmin +720 -exec rm {} \;

 

Top