0byt3m1n1
Path:
/
data
/
16
/
inventory
/
[
Home
]
File: domaindirlist.pl
#!/usr/bin/perl use NDBM_File; use File::Find; use vars qw/*name/; *name = *File::Find::name; my $PATHDB = "/data/config/web/fspath"; #open ALLPATHS, ">/data/16/inventory/allpaths.txt"; my %dirs; tie(%dirs, 'NDBM_File', "$PATHDB", 1, 0) || die "$!"; my %logdir; my %bkdir; my %mtdir; my %LOGDIRCHECK; my %METALOGCHECK; my %BKUPCHECK; while((my $key, my $val) = each %dirs) { # skip suspended accounts next if $val eq "/data/applications/suspend_other"; next if $val eq "/data/templates/default/suspend_other"; next if $val eq "/data/templates/default/suspend_band"; next if $val eq "/data/templates/inquent.netsol/suspend_other"; next if $val eq "/data/templates/inquent.netsol/suspend_band"; print "$key, $val\n"; # my $htdir; # if ($val =~ /(\/data\/(\d+\/){5}user\/\d+\/)(htdocs.*)/) { #$htdir = $val; #$hthash{$htdir} = 1; #print ALLPATHS "$htdir\n"; #$backup = $1 . "backup/backup.zip"; #$bkhash{$backup} = 1; #(my $meta = $1) =~ s/user/meta/; #$mtlog = $meta . "logs"; #$mthash{$mtlog} = 1; #$logdir = $val . "/log"; #$loghash{$logdir} = 1; #} # @LOGDIRS = keys %LOGDIRCHECK; # @MTLOGS = keys %METALOGCHECK; # @BKUPS = keys %BKUPCHECK; } #untie(%dirs); #@MTARY = keys %mthash; #@BKARY = keys %bkhash; #@LOGARY = keys %loghash; # #push(@ARY, @MTARY); #push(@ARY, @BKARY); #push(@ARY, @LOGARY); # #@MTARY = (); #@BKARY = (); #@LOGARY = (); # ##foreach(@ARY) { # print ALLPATHS "$_\n"; #} #@ARY = (); #close ALLPATHS; #open ALLPATHS, "</data/16/inventory/allpaths.txt"; #$index = 0; #while ($index <= 18) { #This creates and opens files for splitting up based on /data/# locations # $data = "data$index"; # open ${data}, ">/data/16/inventory/domlists/${data}"; # $index++; #} #while (<ALLPATHS>) { #This separates the various paths into files based on their /data/# location # chomp($_); # $line = $_; # $handle = (split /\//, $line)[2]; # $file = "data$handle"; # print ${file} "$line\n" if ($line =~ /^\/data\/$handle\//); #} #$index = 0; #while ($index <= 18) { #This closes all the path lists. # $data = "data$index"; # close ${data}; #$index++; #} # #$index = 0; #while ($index <= 18) { #This breaks the list of paths down into four parts. # $file = "data$index"; # $count = (split /\s/ ,(`wc -l /data/16/inventory/domlists/$file`))[0]; # $inflate = 1.05 * $count; # $lines = sprintf("%.0f", ($inflate/2)); # `split -l $lines /data/16/inventory/domlists/$file /data/16/inventory/domlists/$file-`; # `rm /data/16/inventory/domlists/$file`; # $index++; #} # #`rm /data/16/inventory/allpaths.txt`;