Gentoo Archives: gentoo-user

From: Alan McKinnon <alan@××××××××××××××××.za>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] date-specific cp/mv
Date: Thu, 28 Sep 2006 16:54:40
Message-Id: 200609281847.52901.alan@linuxholdings.co.za
In Reply to: [gentoo-user] date-specific cp/mv by maxim wexler
1 On Thursday 28 September 2006 18:16, maxim wexler wrote:
2 > Hi group,
3 >
4 > I'd like to be able to cp or mv certain files from a
5 > dir according to their timestamp.
6 >
7 > man cp mentions the '--preserve' option but I don't
8 > think that's what I need.
9 >
10 > Does somebody know of some sort of script or perl or
11 > python pass that'll do it?
12
13 use find with the time-related options and -exec. To move
14 everything in ~/mystuff that's older than 3 days (72 hours) to
15 ~/backup, you could use
16
17 find ~/mystuff -type f -mtime 72 -exec mv {} ~/backup \;
18
19 find has many options related to searching by time (hours,
20 minutes, etc) and you can select by atime, ctime or mtime. It's
21 all in the man page
22
23 alan
24 --
25 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] date-specific cp/mv maxim wexler <blissfix@×××××.com>