Programing, Shell scripting, Windows, Linux. I'm using this as a repository for all those niggling little tasks that get done just often enough to be annoying, but maybe not often enough to commit to memory, and other things I feel like writing about.
Thursday, February 21, 2008
Deleting Files over Certain Age
The command to delete files over a certain age is deceptivly easy in linux.
find * -mtime +5 -exec rm {} \;
That finds all files over 5 minutes old in the current directory. This is quite usefull in a backup script run from cron.
No comments:
Post a Comment