On Saturday 07 December 2019 10:05:31 Michael wrote:
On Saturday 07 December 2019 05:00:56 am Gene Heskett
wrote:
What I'd like to do is ask linux to lie
during one more copy
operation, by having a script scan the header of the message for the
oldest date, which likely is the date the message was rx'd here, and
assign the filesystems creation date from that header date. This
would have the effect of restoreing the time differences it is
sorting by such that there should not be 50 messages all sharing the
same second in 2017 creation date from the last copy operation which
is the situation now.
Hi Gene,
Yup, can be done!
“grep” will let you find a date.
use bash to look at filename, grep -A2 for Received, grep -A2 for
localhost, grep that for the 3rd line which will contain the arrival
date in UTC -0500 format, at least for the qmail server at
wdtv.com,
I've had several mail access servers over the last 20 years including
the infamous gmail since I switched from amigados to linux in 1998,
never had a winbox here till earlier this year bought a cheap one to
display the output of a redpitaya's VNA function.
"stat" will let you see a file's Access,
Modify, Change, and Birth
datetimes.
All of which would appear to be bogus for this use due to the several
times its been copied en-mass, usually by mc.
But by using touch, the above derived date could be applied to the file,
but which option modifies the all important creation date? Man touch
doesn't appear to specifically cover that under the -D option, or am I
looking at the wrong option?
Done with several elseif's and some break exits for when we have a grep
hit, it could be done to each folders cur dir, even more than once
because that header date as part of the file, is not volatile. And just
as important, it could be done insitu on a live system. And the next
time kmail gets around to re-indexing that dir, all the copy damage
would be undone.
This would refresh my bash skills, which have been getting quite rusty as
I've not written anything of note recently, like in 10 years.
“touch” will let you change Access and Modify
datetimes.
Humm, but I want to modify the creation times, to make that equal arrival
time from the date/time of arrival from $servername in the header. Even
the pinfo version can only diddle access (atime) and modify time (mtime)
but no mention of ctime is made. That sounds like I am screwed. Do we
have anything which can diddle the ctime's?
The first Ref: gives a find loop to use. The second Ref: gives a
(possibly risky) method to modify the Change time. Google for grep,
tons of examples of that (and tons of ways to do the same thing with
it)
Best,
Michael
Ref:
https://askubuntu.com/questions/62492/how-can-i-change-the-date-modifi
ed-created-of-a-file
https://www.shellhacks.com/fake-file-access-modify-change-timestamps-l
inux/
https://www.thegeekstuff.com/2012/11/linux-touch-command/
---------------------------------------------------------------------
To unsubscribe, e-mail:
trinity-users-unsubscribe(a)lists.pearsoncomputing.net For additional
commands, e-mail: trinity-users-help(a)lists.pearsoncomputing.net Read
list messages on the web archive:
http://trinity-users.pearsoncomputing.net/ Please remember not to
top-post:
http://trinity.pearsoncomputing.net/mailing_lists/#top-posting
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>