hello i have a web folder in which files are created at regular intervals . Is it possible to automatically delete the files which are 1 hour older from that folder ? i hope i can get solution from experienced members here at DP
You can certainly delete files that haven't been modified in the last 24 hours (assuming this is linux ...) find . -mtime +1 -exec rm {} \; (obviously be careful where you run this!) Would need to think a bit more about an hour old though ... Matt
are you sure about this.. because i dont want to loose my other data..... i want to delete files of folder www/gaurav/temp - for example .. now can you tell me exact code and how to run it .. i am new to linux
Hi there, I suggest you create some temporary files and folders and have a play with these commands before you run them on any important data to find out what they are going to do. Also, make sure you've got a current backup of any important data. Regards - Matt
hey my friend made me this script for me.... The problem is that it has constant folder address.. and i dont want that.. what i want is that in whichever folder the script is placed it should check the files and delete them without deleting itself!