To remove periodically some files from a specific directory you can easily setup a cron entry. Execute in shell
crontab -e
and add
*/60 * * * * find /home/my_home/some_dir/ -name '*.dat' -mmin +60 -exec rm {} \;
where .dat is the suffix of the files and "-mmin +60 -exec rm {}" is the option telling to remove the files with data modified more than 60 minutes ago.
If your crontab uses Vim for editing use :wq to save you changes and "INSERT", "ESC" to switch between Insert and Normal mode.
Tuesday, March 25, 2008
How to periodically remove temporary files in Linux
o 3:34 AM
Subscribe to:
Post Comments (Atom)
1 komentárov:
Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Celular, I hope you enjoy. The address is http://telefone-celular-brasil.blogspot.com. A hug.
Post a Comment