Solved

Date problem on SGI Irix 6.2

Posted on 1997-03-04
3
271 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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 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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now