From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: Thorsten Schlueter <thorsten.s@spans.de>
Subject: Re: Digital ES40 installation date 2019
Date: 1999/09/21 [thread overview]
Message-ID: <37E7893C.B03C4B64@ife.ee.ethz.ch> (raw)
In-Reply-To: 37E782EB.1FCB4991@spans.de
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 <rhomberg@ife.ee.ethz.ch>
#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] <fromyear> <toyear> [<file1> [<file2> [...]]]\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
next prev parent reply other threads:[~1999-09-21 4:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-21 4:00 Digital ES40 installation date 2019 Thorsten Schlueter
1999-09-21 4:00 ` Addy
1999-09-22 4:00 ` Jan Doornaert
1999-09-21 4:00 ` Alex Rhomberg [this message]
1999-09-21 4:00 ` Hmmm ES40 and RH ?[Was:Re: Digital ES40 installation date 2019] Andrei A. Dergatchev
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox