From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,555fea75f717f418 X-Google-Attributes: gid111c93,public From: Alex Rhomberg Subject: Re: Digital ES40 installation date 2019 Date: 1999/09/21 Message-ID: <37E7893C.B03C4B64@ife.ee.ethz.ch>#1/1 X-Deja-AN: 527817738 Content-Transfer-Encoding: 7bit References: <37E782EB.1FCB4991@spans.de> To: Thorsten Schlueter Content-Type: text/plain; charset=us-ascii X-Trace: 21 Sep 1999 15:33:48 +0100, beethoven.ee.ethz.ch Organization: Electronics Lab, ETH Zurich, Switzerland MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha Thorsten Schlueter wrote: > > Hi ! > > I have to set up Redhat 6.0 on a Digital Alpha ES40. I set the CMOS time > to 1999, but the system config files are still dated 2019, which makes > my license server think that I'm trying to cheat it. I played around > with several timezone settings and even with the 'Startup through ARC > console' setting, but the config files are still at 2019. Hi Thorsten I though with RH6.0 the problem was solved. Is it the system time or only the date stamps of the files? the RH 6.0 clock (clock-1.1-6) automagically gets the correct clock. You can change the date of the files by using the following script. the date of symlinks can only be changed by removing and relinking, but I think their date is not relevant. I still have some 100 symlinks from 2018 :-) ***********BEGIN SCRIPT**************** #!/usr/bin/perl -w #OUCH! no use strict... seems to come from my earlier Perl days... # chyear # changes access or modification year of a file # based on a program by Robert Harley # Author: Alex Rhomberg #usage: first come the options (-a to modify access, -m to modify modify time) #then comes fromyear, then toyear, then the filenames #filenames can also be supplied through stdin #examples: #touch /tmp/now; find / -newer /tmp/now |chyear 2038 1998; rm /tmp/now #touch /tmp/now; chyear 2038 1998 `find / -newer /tmp/now`; rm /tmp/now my $usage = "Usage: $0 [-m] [-a] [ [ [...]]]\n". "\t-m modifies modify time, -a the access time\n". "if no option is given, both times are modified\n". "if no filename is given, they are taken from stdin\n"; use POSIX; # needed for mktime die $usage if $#ARGV < 1; my ($modacc, $modmod) = (0,0); while ($ARGV[0] =~ /^-(.*)$/) { shift; $modacc = 1 if $1 eq 'a'; $modmod = 1 if $1 eq 'm'; die $usage unless $1 =~ /^[am]$/; } $modacc = $modmod = 1 unless $modacc||$modmod; die $usage if $#ARGV < 1; my $fromyear = shift; my $toyear = shift; die "$0: years are strange\n" if (($fromyear < 1970) || ($fromyear > 2037) || ($toyear < 1970) || ($toyear > 2037)); if (@ARGV) { while(@ARGV) { $_ = shift; chyear($fromyear, $toyear, $_) unless -l $_; } } else { while (<>) { chyear($fromyear, $toyear, $_) unless -l $_; } } sub chyear { my $fy = shift() - 1900; my $ty = shift() - 1900; my $file = shift; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = lstat($file); my @time = localtime ($atime); my $mod = 0; if($modacc) { if ($time[5] == $fy) { $time[5] = $ty; $atime = mktime(@time); $mod = 1; } } @time = localtime($mtime); if($modmod) { if ($time[5] == $fy) { $time[5] = $ty; $mtime = mktime(@time); $mod = 1; } } if ($mod) { print "changing $file\n"; utime $atime, $mtime, $file if $mod; } } ************** END SCRIPT ******************* - Alex