11 |
# |
# |
12 |
# 2000-02-16 Dobrica Pavlinusic <dpavlin@pliva.hr> prva perl verzija |
# 2000-02-16 Dobrica Pavlinusic <dpavlin@pliva.hr> prva perl verzija |
13 |
# 2000-03-01 DbP poravljen ignore_dirs grep bug |
# 2000-03-01 DbP poravljen ignore_dirs grep bug |
14 |
|
# |
15 |
|
# 2000-03-31 Hana sada ignorira sve sto ^eng$, ^eng_ , ^adresar$ u imenu direktorija |
16 |
|
|
17 |
#$mod_time = 10*60; # 10 minuta |
$mod_time = 10*60; # 10 minuta |
18 |
$mod_time = 24*60*60; # 1 day |
#$mod_time = 24*60*60; # 1 day |
19 |
|
|
20 |
$verbose = 0; |
$verbose = 0; |
21 |
|
|
22 |
@ignore_dirs=( "/data/web/public/adresar/", "/data/web/public/eng" ); |
#@ignore_dirs=( "/data/web/public/adresar/", "/data/web/public/eng" ); |
23 |
|
|
24 |
if (! defined(@ARGV)) { |
if (! defined(@ARGV)) { |
25 |
@dirs=( "/data/web/public", |
@dirs=( "/data/web/public", |
31 |
foreach $dir (@dirs) { |
foreach $dir (@dirs) { |
32 |
opendir(DIR,"$dir") || warn "can't open $dir: $!"; |
opendir(DIR,"$dir") || warn "can't open $dir: $!"; |
33 |
foreach $f (grep { !/^\./ } readdir(DIR)) { |
foreach $f (grep { !/^\./ } readdir(DIR)) { |
34 |
if (-f "$dir/$f" && ! -l "$dir/$f") { |
if (-d "$dir/$f" && $f !~ /^eng$/ && $f !~ /^adresar$/ && $f !~ /^eng_/) { |
35 |
print "jedan od fileka dir/$f\n"; |
$push_it = 1; |
36 |
|
push @dirs,"$dir/$f" if ($push_it); |
37 |
|
} |
38 |
|
elsif (-f "$dir/$f" && ! -l "$dir/$f") { |
39 |
@stat = stat(_); |
@stat = stat(_); |
40 |
if ($f =~ /\.html/ && (time() - $stat[9]) < $mod_time) { |
if ($f =~ /\.html/ && (time() - $stat[9]) < $mod_time) { |
41 |
|
print "filek za mjenjanje `$dir/$f\n" if ($verbose); |
42 |
push @files,"$dir/$f"; |
push @files,"$dir/$f"; |
43 |
} |
} |
44 |
} elsif (-d "$dir/$f") { |
else { |
45 |
$push_it = 1; |
print "ovo je staro: $dir/$f\n" if ($verbose); |
|
foreach $ig_dir (@ignore_dirs) { |
|
|
# print "\t$dir/$f -- $ig_dir\n"; |
|
|
if ("$dir/$f" =~ m,$ig_dir,) { |
|
|
print "skipping $dir/$f (in ignore list)\n" if ($verbose); |
|
|
$push_it = 0; |
|
|
} |
|
46 |
} |
} |
47 |
push @dirs,"$dir/$f" if ($push_it); |
} |
48 |
} else { |
elsif ($f =~ /^eng$/ || $f =~ /adresar/ || $f =~ /^eng_/) { |
49 |
print "skipping $dir/$f\n" if ($verbose); |
print "preskacem jer je eng ili adresar $dir/$f\n" if ($verbose); |
50 |
|
} |
51 |
|
else { |
52 |
|
print "ovo je link $dir/$f\n" if ($verbose); |
53 |
} |
} |
54 |
} |
} |
55 |
closedir DIR; |
closedir DIR; |
56 |
} |
} |
57 |
|
|
|
#foreach $file ("/data/web/public/VIJESTI/30ozpotpiskol.html") { |
|
58 |
foreach $file (@files) { |
foreach $file (@files) { |
59 |
if (open(IN,"$file")) { |
if (open(IN,"$file")) { |
60 |
print "$file\n" if ($verbose); |
print "$file\n" if ($verbose); |
114 |
s/čaracteris/characteris/g; |
s/čaracteris/characteris/g; |
115 |
s/ČARACTERISTICS/CHARACTERISTICS/g; |
s/ČARACTERISTICS/CHARACTERISTICS/g; |
116 |
s/čart /chart /g; |
s/čart /chart /g; |
117 |
|
s/-čart/-chart/g; |
118 |
s/caš/cash/g; |
s/caš/cash/g; |
119 |
s/cašless/cashless/g; |
s/cašless/cashless/g; |
120 |
s/čarset/charset/g; |
s/čarset/charset/g; |
271 |
s/Tošiba/Toshiba/g; |
s/Tošiba/Toshiba/g; |
272 |
s/Marč/March/g; |
s/Marč/March/g; |
273 |
|
|
274 |
|
s/Attach/Attach/g; |
275 |
|
s/attachment/attachment/g; |
276 |
|
s/show/show/g; |
277 |
|
|
278 |
} |
} |