2009/02/19
2009/02/18
2009/02/17
2009/02/15
Perlで1日以上古いファイルのgzip圧縮(特定ディレクトリを以下すべてを再帰的に)
#!/usr/bin/perl
use File::Find;
@directories_to_search = "圧縮したいファイルの保管されたディレクトリのフルパス";
find(\&wanted, @directories_to_search);
sub wanted{
my $file = $File::Find::name;
if ($file =~ /\.gz/) {
} else {
if (-f $file){
system ("/bin/gzip $file")
# print $file,"\n"
if (-M "$file" > 1);
}
}
}
use File::Find;
@directories_to_search = "圧縮したいファイルの保管されたディレクトリのフルパス";
find(\&wanted, @directories_to_search);
sub wanted{
my $file = $File::Find::name;
if ($file =~ /\.gz/) {
} else {
if (-f $file){
system ("/bin/gzip $file")
# print $file,"\n"
if (-M "$file" > 1);
}
}
}
Perlで1日以上古いファイルのgzip圧縮
#!/usr/bin/perl
$dirlinkfile = "圧縮したいファイルの保管されたディレクトリのフルパス";
opendir(DIR,$dirlinkfile);
@dirfile = readdir DIR;
closedir DIR;
foreach $dirfile(@dirfile){
system ("/bin/gzip $dirlinkfile/$dirfile")
if (-f "$dirlinkfile/$dirfile" && -M "$dirlinkfile/$dirfile" > 1);
}
$dirlinkfile = "圧縮したいファイルの保管されたディレクトリのフルパス";
opendir(DIR,$dirlinkfile);
@dirfile = readdir DIR;
closedir DIR;
foreach $dirfile(@dirfile){
system ("/bin/gzip $dirlinkfile/$dirfile")
if (-f "$dirlinkfile/$dirfile" && -M "$dirlinkfile/$dirfile" > 1);
}
2009/02/12
2009/02/11
Perlで365日以上古いファイルの削除
#!/usr/bin/perl
$dirlinkfile = "削除したいファイルの保管されたディレクトリのフルパス";
opendir(DIR,$dirlinkfile);
@dirfile = readdir DIR;
closedir DIR;
foreach $dirfile(@dirfile){
unlink("$dirlinkfile/$dirfile")
if (-f "$dirlinkfile/$dirfile" && -M "$dirlinkfile/$dirfile" > 365);
}
$dirlinkfile = "削除したいファイルの保管されたディレクトリのフルパス";
opendir(DIR,$dirlinkfile);
@dirfile = readdir DIR;
closedir DIR;
foreach $dirfile(@dirfile){
unlink("$dirlinkfile/$dirfile")
if (-f "$dirlinkfile/$dirfile" && -M "$dirlinkfile/$dirfile" > 365);
}
2009/02/10
2009/02/08
2009/02/07
2009/02/03
2009/02/01
Zabbix, SNMP traps mapped to the right host « Pierky’s Blog
Zabbix, SNMP traps mapped to the right host « Pierky’s Blog: "bix_sender ZABBIX_SENDER='/home/zabbix/zabbix-1.6.2/src/zabbix_sender/zabbix_sender'; # path to zabbixhosts"
メモめもMemo・・・ » iscsi
メモめもMemo・・・ » iscsi: "etch1:~# iscsiadm -m node --target iqn.2001-04.com.example:storage.disk2.sys1.xyz --portal 192.168.0.187 --op update -n node.session.auth.authmethod -v CHAP etch1:~# iscsiadm -m node --target iqn.2001-04.com.example:storage.disk2.sys1.xyz --portal 192.168.0.187 --op update -n node.session"
登録:
投稿 (Atom)