You can do this, but there are several different ways depending on the timestamp criteria you are concerned with. For example, find has several different ways to compare whether or not a file has been modified in 'n' minutes or whether a file has been modified since another file. Using 'date', 'ls', and 'awk' you can use just about any date criteria to conditionally rm certain files. If you want to rotate logs, use the logrotate.d service, which is cron based.
Can you give a specific example of what timestamp criteria you are looking to examine?
|