On Thursday 28 September 2006 18:16, maxim wexler wrote:
> Hi group,
>
> I'd like to be able to cp or mv certain files from a
> dir according to their timestamp.
>
> man cp mentions the '--preserve' option but I don't
> think that's what I need.
>
> Does somebody know of some sort of script or perl or
> python pass that'll do it?

use find with the time-related options and -exec. To move 
everything in ~/mystuff that's older than 3 days (72 hours) to 
~/backup, you could use

find ~/mystuff -type f -mtime 72 -exec mv {} ~/backup \;

find has many options related to searching by time (hours, 
minutes, etc) and you can select by atime, ctime or mtime. It's 
all in the man page

alan
-- 
gentoo-user@gentoo.org mailing list

Reply via email to