Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
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.
I have a website and I want to modify some page elements but then restore the last modified time to what it was before I updated the file.
At the bottom of my pages I use php to read the last modified time of the document and print it to the page.
I have articles and other stuff that I do not want the time stamp to change, but I need to tweak the contents of the <head>. So nothing on the page is changing, just some meta tags.
The closest way I have found to do this would be to tar the whole site, make my changes, then read the time stamps from the files in the tar file, then use touch -mt to change the time stamps back.
How do I get the last modified timestamps from with in the tar file?
And can I have the timestamps outputted to a file with the time-stamp and the path?
Then How do I pipe that info to touch?
Is this possible?
What a headache, I'm going to do this kind of stuff with includes from now on so I don't need to worry about this again.
I had been getting mixed results with this. Some of the times were showing up incorrect. I use this technique once in a while. Well what is happening is the original command specified %C which returns the last Status Change. I need it to show the last modification time. For this you use %T.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.