I'm looking for a cron job that will delete files and sub-directories within a directory on a daily basis... Example: www.mysite.com/directory/ <-- the cron job is made to delete all files and sub-directories created inside this sub-directory on a daily basis. www.mysite.com/directory/file1.php <-- deleted daily www.mysite.com/directory/1/ <-- deleted daily I would use this cron but i think it only deletes the files with in the directory and doesnt delete the sub-directories.. find /directory -maxdepth 1 -type f -mtime +7 -exec rm -f {} \; Code (markup):