Скрипт:
#this script search for frag on a fs
use strict;
#number of files
my $files = 0;
#number of fragment
my $fragments = 0;
#number of fragmented files
my $fragfiles = 0;
#search fs for all file
open (FILES, «find » . $ARGV[0] . " -xdev -type f -print0 |");
$/ = «\0»;
while (defined (my $file = <FILES>)) {
open (FRAG, "-|", «filefrag», $file);
my $res = <FRAG>;
if ($res =~ m/.*:\s+(\d+) extents? found/) {
my $fragment = $1;
$fragments += $fragment;
if ($fragment > 1) {
$fragfiles++;
}
$files++;
} else {
print («$res : not understand for $file.\n»);
}
close (FRAG);
}
close (FILES);
print ( $fragfiles / $files * 100 . «% non contiguous files, » . $fragments / $files . " average fragments.\n");
Выдает:
[soz@localhost Загрузки]$ ./frag.pl /soz
./frag.pl: line 2: use: команда не найдена
./frag.pl: line 5: my: команда не найдена
./frag.pl: line 7: my: команда не найдена
./frag.pl: line 9: my: команда не найдена
./frag.pl: line 12: syntax error near unexpected token `FILES,'
./frag.pl: line 12: `open (FILES, «find » . $ARGV[0] . " -xdev -type f -print0 |"); '
[soz@localhost Загрузки]$
????????




Ответ на:
комментарий
от koriun

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум фрагментация (2010)
- Форум Debian Lenny 5.0.7 exim 4.69-9 уязвим (2010)
- Форум Postfix фильтр подсчета почты (2010)
- Форум Выполнение скрипта (2014)
- Форум Не запускается отладка в QtCreator на Astra Linux (2024)
- Форум Проверить выполнение скрипта (2016)
- Форум vim выполнение скрипта (2016)
- Форум Выполнение php скриптов (2020)
- Форум Nagios - выполнение скрипта (2013)
- Форум выполнение скриптов (apache) (2005)