Delete files after 24 hours
Hi, I m trying to setup a folder so that its contents are deleted after 48 hours from being placed there.
Based on an old post I would use find /raid/shared/ -mtime +2 -type f -exec rm -rf {} \; If I use this script and run it &, will this use up a lot of memory if it always running? Otherwise, how can I shedule it regulary? I m on Red Hat 9 with Kde. Is there a better way? Thanks a mil! Bye!! |
hi there,
depend on how many times per 48 hours you want to check... my suggestion: setup a cron, maybe hourly. i think it will be ok.. regards, slackie1000 [edit] 1. go to /etc/cron.hourly 2. copy your executable there 3. and it is done. be sure that "crond" is running.. |
that was fast :D
Thanks a mil! |
hi there,
you are welcome! :cool: regards, slackie1000 |
All times are GMT -5. The time now is 11:43 PM. |