0byt3m1n1
Path:
/
data
/
16
/
.snapshot
/
daily.2025-03-07_0010
/
inventory
/
[
Home
]
File: vuxinv_start.pl
#!/usr/local/bin/perl $host = `hostname`; chomp($host); $listdir = "/data/16/inventory/INVLISTS"; $host =~ s/vux//; exit if ($host == 17); $index = $host % 3; $dataset = (($host + (3 - $index))/3) if (($index == 1) || ($index == 2)); $dataset = ($host/3) if ($index == 0); $dataset = 0 if ($host == 63); $dataset = 0 if ($host == 61); $dataset = 0 if ($host == 62); $dataset = 16 if ($host == 65); exit if ($dataset > 20); #$dataset = 6 if ($host == 66); #$dataset = 6 if ($host == 65); exit if ($host > 66); #$index = 0 if ($index == 21); #$index = 23 if ($index == 17); #$index = 17 if ($index == 22); #$index = "nsoa" if ($index == 22); opendir(LISTDIR, $listdir); @DATAFILES = readdir(LISTDIR); closedir(LISTDIR); if ($index == 1) { $file1 = "data$dataset-aa"; $file2 = "data$dataset-ab"; $file3 = "data$dataset-ac"; $file4 = "data$dataset-ad"; $file5 = "data$dataset-ae"; push(@DODATA, $file1); push(@DODATA, $file2); push(@DODATA, $file3); push(@DODATA, $file4); push(@DODATA, $file5); } if ($index == 2) { $file1 = "data$dataset-af"; $file2 = "data$dataset-ag"; $file3 = "data$dataset-ah"; $file4 = "data$dataset-ai"; $file5 = "data$dataset-aj"; push(@DODATA, $file1); push(@DODATA, $file2); push(@DODATA, $file3); push(@DODATA, $file4); push(@DODATA, $file5); } if ($index == 0) { $file1 = "data$dataset-ak"; $file2 = "data$dataset-al"; $file3 = "data$dataset-am"; $file4 = "data$dataset-an"; $file5 = "data$dataset-ao"; $file6 = "data$dataset-ap"; push(@DODATA, $file1); push(@DODATA, $file2); push(@DODATA, $file3); push(@DODATA, $file4); push(@DODATA, $file5); push(@DODATA, $file6); } #foreach(@DATAFILES) { # $file = $_; # $test = "data$index-"; # push(@DODATA, $file) if ($file =~ /$test/); #} foreach(@DODATA) { $datafile = $_; $datafile = "/data/16/inventory/INVLISTS/$datafile"; chomp($datafile); $script = "/data/16/inventory/vuxinv.pl"; if (! fork) { setpgrp(0,$$); exec ("${script} ${datafile}"); } }