You are here:
» How To Remove Files In A Directory On Cron?
How to remove files in a directory on Cron?
This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.
I have a certain directory I want to delete files from on Cron run every hour. I am running Ubuntu. Please suggest what to do?

1 year 40 weeks ago
Tags:
To run a cron every hour, you need to do something like this on your 'crontab -e' editor:
To remove files from the directory, do following:
You can write a shell script remove-files.sh as follows:
#!/bin/sh rm -rf /home/gamekick/public_html/cache/* find /home/gamekick/public_html/cache/ -ctime 1 -exec rm -f {} \;And run this on cron hourly:
Post Comment