Hello. i need some help.. i need a script to check the directory "/test/test2/". If in this directory there are files with number extensions (like test.1111, test.6500, test.5054 - only files with name test and extension number) i want to delete them. I want this script to run every 5 seconds. It's VERY important for me to have this script. can someone make it for me? I'm running debian.. thanks!
find /path/tho/files -name test.* -exec rm {} \; or find /path/tho/files -name test.[1234567890]* -exec rm {} \; in cron you can run every 1 minute.
You could use the following code and place it in crontab: Code: find /test/test2 -name 'test.*' -exec rm {}\; Make sure you use the crontab of a user with sufficient rights.
You will have to put quotes around the '*', or else the shell will expand it before the find command.
thanks for the answers! this will delete the test.(+nubmers)? cause in the folder there's and the test.so. which is the cronjob to run it every 5 seconds??