?
Solved

Date problem on SGI Irix 6.2

Posted on 1997-03-04
3
Medium Priority
?
280 Views
Last Modified: 2013-12-16
Hi

Because I'm pretty stupid I forgot to check the date when I did an OS upgrade (from Irix 5.3 to IRIX 6.2) a while back.  After using the system for a couple of weeks I noticed a few problems, and it turned out that the system date was set for sometime in the year 2000!  Since I expect this may cause problems, least of all with backups, I think I'd better do something about it ?  I re-installed all the OS compononets, and other stuff I'd installed since, with the system date set correctly, but tons of files/directories still think they were created / modified / whatever in the year 2000?  What to do ?

Most, though not all, of the files showing up as problematic are links rather than normal files, simply touch-ing them doesn't seem to help?

#
# find / -type l -exec ls -l {} \; | fgrep 2000 | more
lrwxr-xr-x    1 root     root          17 Feb 14  2000 /usr/bin/ar -> ../lib/driverwrap
lrwxr-xr-x    1 root     root          17 Feb 14  2000 /usr/bin/as -> ../lib/driverwrap
...
#

Suggestions ?

Kevin
0
Comment
Question by:kmaguire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:kmaguire
ID: 1811825
Didn't really answer the main part of the question at all (only some of the problematic files are links) and only really re-stated the problem in his solution for the links part of the question.   "Write a script to fix it" doesn't really count!  Supplying a script would!

Sorry
Kev
0
 
LVL 2

Expert Comment

by:lockhart
ID: 1811826
swiatek really did answer your question.  swiatek's suggestion is what most sysadmins would do (really dumb ones would do it by hand).  No one can write it for you since only you have access to your system (of course if I had an account and $50/hr I'd be happy to do it for you over the net).  

A more pointed suggestion would be to use perl or awk/sh to parse the output of find (perl has a built-in find module so you don't have to use the system one).  You can then delete the links and recreate them or touch the files/directories suffering from the problem.  There really isn't much else you can do unless you want to reformat/reinstall/restore (your backup/restore tool will give you the option of keeping/changing mod dates).

Happy scripting.

Mike

PS -- No sysadmin worth his/her salt hasn't made mistakes, some much worse.  Try doing an rm -rf .* (he wanted to get rid of the .* FILES in a directory tree).
0
 
LVL 2

Accepted Solution

by:
lockhart earned 300 total points
ID: 1811827
a good starting point might be:

find / -type l -exec ls -l {} \;|fgrep 2000| nawk '/^l/ {print "rm " $9 "\nln -s " $9 " " $11}' | uniq > fix-links

find / -type d -exec ls -l {} \;|fgrep 2000| nawk '/^[d-]/ {print "touch " $9 }' | uniq > fix-df

These commands create 2 script files that you can source to perform the actual fixing.  You might want to look at them first ;)

The last one will touch all directories and files with the string 2000 in their directory listing.  After looking at it, it really wasn't such a big deal.

Mike
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question