Solved

Date problem on SGI Irix 6.2

Posted on 1997-03-04
3
276 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
  • 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 100 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

770 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