LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   filestamps dated in future, X won't boot anymore (https://www.linuxquestions.org/questions/linux-general-1/filestamps-dated-in-future-x-wont-boot-anymore-4175471269/)

peterlowrie 07-28-2013 09:56 PM

filestamps dated in future, X won't boot anymore
 
Dear Groupsters

The battery on my machine was the wrong shape (flat) so I put a new one in. Then by mistake I put the wrong date into BIOS. I put August instead of July. When I noticed the mikate, oops mistake, I of course, changed the date to July but now X wont run.

I can access the machine via another box. Zeroconf, fish, ssh etc all work and the *dm is also running but I cannot log in via the X gui therefore xdmcp wont work either.

I was able to fsck.ext4 the filesystem and I thort that this would change the dates but it didn't.

Does anyone know how I can change the timestamps on the affected files? I've not found any man pages or howtro's that describe what to do. I'm hoping that if I can fix the dates on various files this will be one step in the direction of bringing X login up again.

Thanks
Peter

MemoryLeak 07-29-2013 12:02 AM

If I understand your problem correctly, the 'touch' command may be what you are looking for. Assuming that your system clock is accurate, touch should update the timestamp to the current time. The touch command also allows you to set the date yourself with the --date=STRING option.

Please try 'man touch' to see if it will help you. You may need to touch files in at least one directory recursively, and possibly as the root user.

I hope this helps.

peterlowrie 07-29-2013 06:42 PM

OK, that worked. Here's how I did it!
 
Quote:

Originally Posted by MemoryLeak (Post 4998658)
If I understand your problem correctly, the 'touch' command may be what you are looking for. Assuming that your system clock is accurate, touch should update the timestamp to the current time. The touch command also allows you to set the date yourself with the --date=STRING option.

Please try 'man touch' to see if it will help you. You may need to touch files in at least one directory recursively, and possibly as the root user.

I hope this helps.

Yes. THANK YOU!!!

I took a look at the touch man page and decided to use the '--reference=' method.

I created a file thus:>touch timefile

Then I did
:>touch -c --reference=timefile *
:>touch -c --reference=timefile *.*
:>touch -c --reference=timefile ./.* # to change any hidden files and dirs without extentions, and
:>touch -c --reference=timefile ./.*.* # to change the " files having extentions.

I did not see a way to parse directories so it's a matter of changing to those dirs and repeat above. I was able to do it in my home dir without sudo or root access.

Now I'm going to see if I can boot X. I will report back for the sake of future users referencing these posts.

:-) Peter

MemoryLeak 07-30-2013 05:51 PM

Great! I'm happy to be of assistance. I assume that the timestamp fix allowed you to be able to boot X. Is that right?


All times are GMT -5. The time now is 09:11 AM.