Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-03-2017, 08:51 PM
|
#1
|
LQ Newbie
Registered: Sep 2016
Posts: 2
Rep: 
|
EXTREMELY CHALLENGING -- trying for MONTHS to re-assign file dates stripped by android
I've withdrawn the question, which was not formulated per forum guidelines. Thanks to all who responded.
Last edited by ericnyc1000; 01-12-2017 at 08:35 PM.
Reason: poorly worded question
|
|
|
01-04-2017, 03:46 AM
|
#2
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,039
|
Not sure why you think any other OS will do any better a job as a standard copy in any will affect the modification information.
That being said, I did see that rsync has a -t option which specifically says it is there to not alter the modification information:
Code:
-t, --times preserve modification times
I would suggest that you need to review the man page closer and find all the necessary options that will allow you to achieve your task.
I would also add that the process seems a little flawed to me as you are copying all your files to a new location only to then move them again into your 'new structure' which if using cp or mv without options
will also again change the dates / times.
I will finish by saying that all the people on LQ are here because they enjoy what they do and do not expect any remuneration apart from a thank you, so telling us we 'have to' stay with you through the
process may not garner you a lot of responses.
Good luck. I will be keen to see how you get on 
|
|
|
01-04-2017, 04:21 AM
|
#3
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,437
|
The whole idea of posting onto yet another forum without stating the suggestions so far seems pointless.
Probably any suggestion will be met with "I already tried that" - that will make you even less popular. Yet more time wasted.
|
|
|
01-04-2017, 04:38 AM
|
#4
|
Member
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
|
I empathize with &hear your extreme frustration &upset.
cp -p --attributes-only? Look into: touch -r OLD NEW (`stat` concept)
Since I'm not good at scripting (nor rsync), I'd simply:
`find` (like ls -R) all the names into 2 *matching* (hugely-long) file lists,
paste oldlist newlist > mycmdlist
then (on mycmdlist) use vi's :%s/^/touch -r /
It produces like: touch -r /path/to/OLD/fileN /newpath/fileN
Of course, try tiny test-cases first. The 2 lists must match exactly.
IF diff systems, find ... -ls|cut -c 61-72 Use touch -d "..." (vi old :%s/$/"/)
Whether or not OP ever reads/tries/is helped by this, or replys, I've enjoyed & learned from working on this. Best wishes.
btw, what "linux forum actually assigns you a person to see your situation through"?
(is it the forum or the [ran-away?] person that "can't find"?)
Last edited by Jjanel; 01-06-2017 at 12:20 AM.
|
|
|
01-04-2017, 08:03 AM
|
#5
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,968
|
Hi Eric and welcome to LQ. Your question is both poor, very demanding in title as well as content.
Since you've spent months on this as you say and have written loops, then why don't you take the extra time to post your code and describe your attempts in more, plus much well organized and clearer detail.
Otherwise members here cannot help you if the tone with which you ask comes across as an urgent demand for help to fix something you've spent months on, but still have not too well described.
Note that copy-replace will update the modification date of a file. You've cited partial requirements for your project.
|
|
|
01-05-2017, 06:57 AM
|
#6
|
Member
Registered: Sep 2011
Distribution: Puppy
Posts: 601
Rep: 
|
A simple Google search shows ways of doing it.
|
|
|
01-05-2017, 07:34 AM
|
#7
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,959
|
Even someone with only a bit of basic knowledge would know that trying would likely give the required info.
|
|
|
01-05-2017, 07:38 AM
|
#8
|
Member
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286
Rep:
|
Quote:
Originally Posted by ericnyc1000
It's acceptable to copy the entire OLD-FILE to the NEW-FILE,
replacing it, since the files are identical.
|
Then why not throw the whole new directory structure away and start with the copy again, this time with
Code:
cp -a /path/to/old/structure
which should preserve alls dates and ownership/permission information? Or did you already modify the directory structure in the new path?
|
|
|
01-05-2017, 07:53 AM
|
#9
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,968
|
Another tact here is to better understand just exactly what you're attempting and why you're attempting it. You speak of a project and a necessity to start over with an entirely different OS and all.
Partially what you seem to be talking about is merging files between things like source repositories and resolving the differences between various versions.
However you should describe better what you want to accomplish.
If this is similar to what you're doing, there are 2-3 paths, however they are not totally free of effort, or cost. For instance there are commercially supported SCCS software products, they cost a lot, or some cost a lot; however they are worth it. They are not necessarily set up overnight, however they support you to get you going and keep you going, because those products are costly. There are cheaper alternatives, and there are freeware alternatives. You get what you pay for mostly in this situation. While a free tool may be entirely acceptable and do what you need, you also will have no support and therefore have to accomplish the set up and support for it on your own. You also can write your own by writing code and scripts. This is what you've been attempting, unsuccessfully. Another option is to hire someone. There is risk in this also because you don't seem to have a well defined project description and if you hire the wrong person, or even a talented person, but give them poor input as to what you want, you'll expend R&D dollars doing the incorrect choices for your project.
Once again I invite you to elaborate a bit further about your project. However I'll also note that LQ is not filled with members who leap into action to take on some large project that happens to get posted in a thread. Instead LQ members are volunteers where the intentions of the site are to help you to help yourself. Get you through a blocking point. And here you need to describe better where you are at and what your project definition is. If it is "I wish to make a file merge tool", then that's a definition. If the next part is that it needs to be UI based, have a manual merge tool to resolve conflicts and then tag versions in a repository for recall of older versions, then that is a more detailed description.
Last edited by rtmistler; 01-05-2017 at 07:54 AM.
Reason: fix typos
|
|
|
01-06-2017, 03:56 AM
|
#10
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by ericnyc1000
So far, my logic is as follows:
For each file in the NEW-FILE directory,
Find its duplicate in OLD-FILE directory.
Then somehow transfer the date of the file in OLD-FILE directory
to corresponding file in NEW-FILE directory.
It's acceptable to copy the entire OLD-FILE to the NEW-FILE,
replacing it, since the files are identical.
|
i don't understand.
if you still have the original files, why don't you just delete the copies with the wrong timestamp, and use the originals?
if you need to copy them somewhere, well make sure that the timestamps are preserved.
another question would be:
why do you think you need the file timestamps for these files? what sort of files/structure are we talking here? why is the timestamp essential?
|
|
|
01-06-2017, 07:10 AM
|
#11
|
LQ Guru
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,937
Rep: 
|
Use rsync to back up your files to the android system.
(See man rsync for details.)
|
|
|
01-06-2017, 10:24 AM
|
#12
|
Member
Registered: Sep 2011
Distribution: Puppy
Posts: 601
Rep: 
|
The timestamp would be important in forensic investigations.
I have had people try to say they used a particular version and tried overwriting the correct version with the one they insisted they used. The timestamps said otherwise. They forgot that the timestamp of the module that failed is included in the dump and tried updating the library with an old version.
|
|
|
01-17-2017, 03:20 PM
|
#13
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,385
|
Quote:
Originally Posted by ericnyc1000
I've withdrawn the question, which was not formulated per forum guidelines. Thanks to all who responded.
|
Editing your original post to delete the entire question after receiving a dozen replies is not helpful, nor respectful of those who have replied. It also leaves the the entire thread a confusing and pointless destination for anyone who may arrive here by some future search results - answers with no context at all.
Please don't do that.
If your original question turned out to be not well formulated then you should rephrase the question or add missing details in reply to questions asked by others, per the forum guidelines.
|
|
1 members found this post helpful.
|
01-17-2017, 03:30 PM
|
#14
|
Member
Registered: Sep 2011
Distribution: Puppy
Posts: 601
Rep: 
|
Quote:
answers with no context at all
|
At best, or possibly looking even stupid!!
|
|
|
01-18-2017, 06:53 AM
|
#15
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,968
|
Closing thread.
ericnyc1000 if you wish to update the question with further information, please use the contact us link at the bottom of the page.
|
|
|
All times are GMT -5. The time now is 11:46 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|