Solved

Date problem on SGI Irix 6.2

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

820 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