Re: [OpenIndiana-discuss] using touch ... whats wrong here
v...@bb-c.de (Volker A. Brandt) writes: > Hi Harry! > > >> find scripts/perl/ -cnewer NewerThan -and ! -cnewer ButNotNewerThan > > Stupid question: Which find are you using? The -cnewer construct gnu find ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] using touch ... whats wrong here
Thanks for the good input... yes I see it is `-newer' I was after... not -cnewer. ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] using touch ... whats wrong here
On Thu, Dec 3, 2015 at 7:52 AM, Harry Putnamwrote: > Not particularly and OI question but that is where I need this > technique to work. I'm hoping some of you old shell hands will > see the problem. > > I hope not to be exibiting true ignorance... but here I go. > > I keep messing with one forumlation of find cnmd that seems like it > aught to work... What am I doing wrong or not understanding? > > I'm trying to use finds' -c newer technique > > Check on just two of many files with following dates. > > Two of quite a few files in this location: > -rwxr-xr-x 1 harry nfsu 1768 2014-07-22 20:18 scripts/perl/getad > -rwxr-xr-x 1 harry nfsu 6429 2014-07-22 20:18 scripts/perl/rnami.pl > > To my eye, those dates fall within the targetting files > > Now create our targeting files with target date inbetween > > touch NewerThan -t 201406141130 > > touch ButNotNewerThan -t 201408141130 > > Now check my targeting files: > > ls -l NewerThan ButNotNewerThan > -rw-r--r-- 1 harry nfsu 0 2014-08-14 11:30 ButNotNewerThan > -rw-r--r-- 1 harry nfsu 0 2014-06-14 11:30 NewerThan > > Ok, now try it up > > find scripts/perl/ -cnewer NewerThan -and ! -cnewer ButNotNewerThan > > (Nada) > > Where is the flaw? > You're mixing the various timestamps. A file has three timestamps: access, shown by ls -lu modify (of data), shown by ls -l creation (or modify metadata), shown by ls -lc Using find -cnewer (a gnu extension) looks at the creation time. The creation time of the files you're using as the comparison will be just now, so won't work. If you want to compare against the regular modification time (which is the time shown in your ls output), then just use -newer. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/ ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] using touch ... whats wrong here
Hi Harry! > find scripts/perl/ -cnewer NewerThan -and ! -cnewer ButNotNewerThan Stupid question: Which find are you using? The -cnewer construct is Gnu find only. The "regular" find in /usr/bin does not understand it. Do you get something like "find: bad option -cnewer"? Regards -- Volker -- Volker A. Brandt Consulting and Support for Oracle Solaris Brandt & Brandt Computer GmbH WWW: http://www.bb-c.de/ Am Wiesenpfad 6, 53340 Meckenheim, GERMANYEmail: v...@bb-c.de Handelsregister: Amtsgericht Bonn, HRB 10513 Schuhgröße: 46 Geschäftsführer: Rainer J.H. Brandt und Volker A. Brandt "When logic and proportion have fallen sloppy dead" ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] using touch ... whats wrong here
is there a particular reason that you can't use just "-newer" ? On 3 December 2015 at 09:34, Volker A. Brandtwrote: > Hi Harry! > > > > find scripts/perl/ -cnewer NewerThan -and ! -cnewer ButNotNewerThan > > Stupid question: Which find are you using? The -cnewer construct > is Gnu find only. The "regular" find in /usr/bin does not understand > it. Do you get something like "find: bad option -cnewer"? > > > Regards -- Volker > -- > > Volker A. Brandt Consulting and Support for Oracle Solaris > Brandt & Brandt Computer GmbH WWW: http://www.bb-c.de/ > Am Wiesenpfad 6, 53340 Meckenheim, GERMANYEmail: v...@bb-c.de > Handelsregister: Amtsgericht Bonn, HRB 10513 Schuhgröße: 46 > Geschäftsführer: Rainer J.H. Brandt und Volker A. Brandt > > "When logic and proportion have fallen sloppy dead" > > ___ > openindiana-discuss mailing list > openindiana-discuss@openindiana.org > http://openindiana.org/mailman/listinfo/openindiana-discuss > ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] using touch ... whats wrong here
On 12/03/15 04:56, Peter Tribble wrote: > You're mixing the various timestamps. Indeed; that's the problem. > access, shown by ls -lu > modify (of data), shown by ls -l > creation (or modify metadata), shown by ls -lc Perhaps a nit, but one I think is important. UNIX (including OpenIndiana) does not keep track of file or directory "creation" time. The 'ctime' element tracks the last attribute change time. There's no way (in UNIX) of knowing when a file was created. And, yes, the OP should be using the file's mtime (the "-newer" option). The attribute change time is rarely what you want. :-/ -- James Carlson 42.703N 71.076W___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] using touch ... whats wrong here
That is the classical answer for ctime. James is correct. However some may find it interesting to note that GPFS does indeed keep the original creation time as an additional attribute that can then be used for policy applications. It is not exposed to Unix, but it's there. Alas, GPFS is only available on AIX and Linux at this time. (misc morning info share) Sent from my android device. -Original Message- From: James Carlson <carls...@workingcode.com> To: openindiana-discuss@openindiana.org Sent: Thu, 03 Dec 2015 8:24 Subject: Re: [OpenIndiana-discuss] using touch ... whats wrong here On 12/03/15 04:56, Peter Tribble wrote: > You're mixing the various timestamps. Indeed; that's the problem. > access, shown by ls -lu > modify (of data), shown by ls -l > creation (or modify metadata), shown by ls -lc Perhaps a nit, but one I think is important. UNIX (including OpenIndiana) does not keep track of file or directory "creation" time. The 'ctime' element tracks the last attribute change time. There's no way (in UNIX) of knowing when a file was created. And, yes, the OP should be using the file's mtime (the "-newer" option). The attribute change time is rarely what you want. :-/ -- James Carlson 42.703N 71.076W <carls...@workingcode.com> ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
[OpenIndiana-discuss] using touch ... whats wrong here
Not particularly and OI question but that is where I need this technique to work. I'm hoping some of you old shell hands will see the problem. I hope not to be exibiting true ignorance... but here I go. I keep messing with one forumlation of find cnmd that seems like it aught to work... What am I doing wrong or not understanding? I'm trying to use finds' -c newer technique Check on just two of many files with following dates. Two of quite a few files in this location: -rwxr-xr-x 1 harry nfsu 1768 2014-07-22 20:18 scripts/perl/getad -rwxr-xr-x 1 harry nfsu 6429 2014-07-22 20:18 scripts/perl/rnami.pl To my eye, those dates fall within the targetting files Now create our targeting files with target date inbetween touch NewerThan -t 201406141130 touch ButNotNewerThan -t 201408141130 Now check my targeting files: ls -l NewerThan ButNotNewerThan -rw-r--r-- 1 harry nfsu 0 2014-08-14 11:30 ButNotNewerThan -rw-r--r-- 1 harry nfsu 0 2014-06-14 11:30 NewerThan Ok, now try it up find scripts/perl/ -cnewer NewerThan -and ! -cnewer ButNotNewerThan (Nada) Where is the flaw? ___ openindiana-discuss mailing list openindiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss