1

Script to delete files older than x days and also taking an input for multiple paths

view story
linux-howto

http://www.unix.com – Hi , I am a newbie!!! I want to develop a script for deleting files older than x days from multiple paths. Now I could reach upto this piece of code which deletes files older than x days from a particular path. How do I enhance it to have an input from a .txt file or a .dat file? For eg: For deleting *.csv files older than Num_days, I am using below piece of code: Code: cd $FILEPATH find ./ -type d ! -name . -prune -o -mtime +$Num_days -name "*.csv" -exec rm {} \; I am using # ! /bin/sh (HowTos)