![]() |
|< 1 2 3 4 >| | ![]() |
37 entries, 4 pages |
1 2 3 4 5 6 7 8 9 10 11 12
# Bei beendigung des Scripts werden alle dat-Files die älter als 4 Tage sind gelöscht. my @datfiles = `ls -lt $filespath \|awk \'\{ print \$9\}\'`; foreach (@datfiles) { chomp(my $file = $_); chomp(my $wholefile = "$filespath/$file"); if (("%.3f",-M $wholefile) > "5") { unlink("$wholefile"); } else { next; } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
xtest11 # ./checksize.pl /home 28
1201601413: starte 'ls -Rlgo /home'...
1201601413: done...
1201601413: vor dem 'sdiff'...
1201601414: diff done...
1201601414: foreach-diff-schleife start
1201601608: foreach-diff-schleife stop
1201601608: start der order schleife
/home/re17830/chksize
build_checksize_db.pl 1630 1619 Diff: 11
checksize.pl 2035 2034 Diff: 1
/home/re17830/chksize/checksize_db
SizeCheck-08-01-29.dat 0 1088595 Diff: 1088595
/home/root
.bash_history 11462 11559 Diff: 97
.sh_history.1 9200 9284 Diff: 84
.vi_history 335 331 Diff: 4
1201601608: order-schleife stop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
print scalar(time) . ": vor dem 'sdiff'...\n"; my @diff = `sdiff $file $tmpfile \|egrep \[\:\\\<\\\>\\\|\]`; print scalar(time) . ": diff done...\n"; print scalar(time) . ": foreach-diff-schleife start\n"; my @order; foreach (@diff ){ if ( $_ =~ m/^(.+):\s+\/.+:$/) { push @order, [$1."\n"]; } elsif ( $_ =~ m/(^\d+)\s+(.+)\s+(.)\s+(\d+)\s+(.+)\s+$/ ) { if ($3 eq "\|") { push @{ $order[-1] },"\t$2\t$1\t$4\t" . "Diff: " . abs($1 - $4) . "\n"; } elsif ($3 eq "\<") { push @{ $order[-1] }, "\tNew File:\t$5\tSize: $4\n"; } elsif ($3 eq "\>") { push @{ $order[-1] },"\tFile deleted:\t$5\n"; } } } print scalar(time) . ": foreach-diff-schleife stop\n"; print scalar(time) . ": start der order schleife\n"; for( @order ){ next if @$_ == 1; print $_ for @$_; } print scalar(time) . ": order-schleife stop\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
xtest11 # perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=aix, osvers=5.2.0.0, archname=aix-thread-multi
uname='aix animals 2 5 000709cf4c00 '
config_args=''
hint=previous, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc_r', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong'
ccversion='5.0.2.0', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -brtl -b32 -bmaxdata:0x80000000'
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lpthreads -lc_r -lcrypt -lbsd -lPW
perllibs=-lbind -lnsl -ldl -lld -lm -lpthreads -lc_r -lcrypt -lbsd -lPW
libc=/lib/libc.a, so=a, useshrplib=true, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp -bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp -bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp -bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp'
cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc_r'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
SUIDPERLIO1 - fix PERLIO_DEBUG buffer overflow (CAN-2005-0156)
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
Built under aix
Compiled at Jan 26 2006 14:30:41
@INC:
/usr/opt/perl5/lib/5.8.2/aix-thread-multi
/usr/opt/perl5/lib/5.8.2
/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi
/usr/opt/perl5/lib/site_perl/5.8.2
/usr/opt/perl5/lib/site_perl
.
xtest11 #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
171899 -k3,3 <
256 .SPOT <
3392 .sh_history <
286 .toc <
4096 audit <
256 auto <
1170 bosinst.data <
51200 cluster.msg.en_US.cspoc.new <
2596 dcebase.obj.cmd_hdr.rodmadd <
12288 dev <
24576 etc <
4096 home <
10958 image.data <
256 itmagent <
256 lost+found <
4096 lpp <
256 mnt <
99 mount.a229578 <
256 networker <
256 nim <
4096 nsr <
4096 opt <
0 proc <
256 sbin <
4520 smit.log <
173 smit.script <
232 smit.transaction <
256 ssl_nimsh <
256 sysback <
256 test <
256 test01 <
256 testdir01 <
256 tftpboot <
4096 tmp <
4096 usr <
4096 var <
<
/.SPOT: <
256 usr <
<
/.SPOT/usr: <
256 sys <
<
/.SPOT/usr/sys: <
256 inst.images <
<
/.SPOT/usr/sys/inst.images: <
<
/audit: <
0 auditb <
[usw.]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Time::HiRes qw(time); my $file = 'test.txt'; open my $fh, '<', $file or die $!; my @diff = <$fh>; close $fh; print time,"\n"; my @order; foreach (@diff ){ if ( $_ =~ m/^(.+):\s+\/.+:$/) { push @order, [$1."\n"]; } elsif ( $_ =~ m/^(\d+)\s+(.+)\s+(.)\s+(\d+)\s+(.+)\s+$/ ) { if ($3 eq "\|") { push @{ $order[-1] },"\t$2\t$1\t$4\t" . "Diff: " . abs($1 - $4) . "\n"; } elsif ($3 eq "\<") { push @{ $order[-1] }, "\tNew File:\t$5\tSize: $4\n"; } elsif ($3 eq "\>") { push @{ $order[-1] },"\tFile deleted:\t$5\n"; } } } print time,"\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/home: /home:
/home/re17830: /home/re17830:
159 .Xauthority | 106 .Xauthority
9734 .sh_history.1 | 7425 .sh_history.1
116 .sh_history.2 | 93 .sh_history.2
/home/re17830/.ssh: /home/re17830/.ssh:
/home/re17830/chksize: /home/re17830/chksize:
1613 build_checksize_db.ksh | 1600 build_checksize_db.ksh
2183 checksize | 2151 checksize
0 test.txt <
/home/re17830/chksize/checksize_db: /home/re17830/chksize/checksize_db:
1076213 SizeCheck-08-01-15.dat | 97882 SizeCheck-08-01-15.dat
1080180 SizeCheck-08-01-16.dat <
/home/re17830/scripts: /home/re17830/scripts:
/home/root: /home/root:
6927 .bash_history | 6910 .bash_history
8402 .sh_history.1 | 2130 .sh_history.1
13310 .sh_history.2 | 13304 .sh_history.2
305 .vi_history | 327 .vi_history
/home/root/.ssh: /home/root/.ssh:
3296 known_hosts | 3068 known_hosts
/home/root/scripts: /home/root/scripts:
/home/webadmin: /home/webadmin:
/home/webadmin/.ssh: /home/webadmin/.ssh:
>
my @diff = `sdiff $file $tmpfile \|egrep \[\:\\\<\\\>\\\|\]`;
![]() |
|< 1 2 3 4 >| | ![]() |
37 entries, 4 pages |