Solved

Date problem on SGI Irix 6.2

Posted on 1997-03-04
3
278 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 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What are recommended OS for exim mail server? 10 130
Unix Question 19 55
unix solaris snoop command 6 138
How to make a Bash alias that takes parameters 5 91
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses

739 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