LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Closed Thread
  Search this Thread
Old 01-03-2017, 09:51 PM   #1
ericnyc1000
LQ Newbie
 
Registered: Sep 2016
Posts: 2

Rep: Reputation: Disabled
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 09:35 PM. Reason: poorly worded question
 
Old 01-04-2017, 04:46 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,769

Rep: Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052
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
 
Old 01-04-2017, 05:21 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,495

Rep: Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099
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.
 
Old 01-04-2017, 05:38 AM   #4
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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 01:20 AM.
 
Old 01-04-2017, 09:03 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,444
Blog Entries: 13

Rep: Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762
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.
 
Old 01-05-2017, 07:57 AM   #6
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
A simple Google search shows ways of doing it.
 
Old 01-05-2017, 08:34 AM   #7
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,653

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Even someone with only a bit of basic knowledge would know that trying
Code:
man touch
would likely give the required info.
 
Old 01-05-2017, 08:38 AM   #8
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 89
Quote:
Originally Posted by ericnyc1000 View Post
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?
 
Old 01-05-2017, 08:53 AM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,444
Blog Entries: 13

Rep: Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762
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 08:54 AM. Reason: fix typos
 
Old 01-06-2017, 04:56 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,422
Blog Entries: 9

Rep: Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668Reputation: 3668
Quote:
Originally Posted by ericnyc1000 View Post
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?
 
Old 01-06-2017, 08:10 AM   #11
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,353

Rep: Reputation: Disabled
Use rsync to back up your files to the android system.
(See man rsync for details.)
 
Old 01-06-2017, 11:24 AM   #12
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
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.
 
Old 01-17-2017, 04:20 PM   #13
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,352
Blog Entries: 11

Rep: Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319
Quote:
Originally Posted by ericnyc1000 View Post
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.
Old 01-17-2017, 04:30 PM   #14
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
Quote:
answers with no context at all
At best, or possibly looking even stupid!!
 
Old 01-18-2017, 07:53 AM   #15
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,444
Blog Entries: 13

Rep: Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762Reputation: 3762
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.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Android: A switcher's thoughts after nine months of using an iPhone LXer Syndicated Linux News 0 06-13-2016 06:15 PM
LXer: The Xposed Framework won't be coming to Android Lollipop for months, if at all LXer Syndicated Linux News 0 10-20-2014 01:11 PM
LXer: .NET Android and iOS clones stripped by Attachmate LXer Syndicated Linux News 0 05-04-2011 03:50 AM
Sort as per the Dates and Months dina3e Linux - Newbie 4 02-22-2010 11:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration