From: Florian Forster Date: Sat, 19 May 2007 08:03:02 +0000 (+0200) Subject: contrib/migrate-3-4.px: Create (sub)directories for the disk plugin. X-Git-Tag: collectd-4.0.0~31 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=034a237b11bf1a8809751f103b01ff1c3859ec2b;p=collectd.git contrib/migrate-3-4.px: Create (sub)directories for the disk plugin. --- diff --git a/contrib/migrate-3-4.px b/contrib/migrate-3-4.px index 613561b9..cbbc179b 100755 --- a/contrib/migrate-3-4.px +++ b/contrib/migrate-3-4.px @@ -341,6 +341,7 @@ sub special_disk my $orig = shift; my $dest_filename = shift; my $dest = shift; + my $dest_directory; $dest->{'type_instance'} = undef; $dest->{'plugin_instance'} = _special_disk_instance ($orig->{'type_instance'}); @@ -351,6 +352,14 @@ sub special_disk $dest->{'type'} = 'disk_merged'; $dest_filename = get_filename ($dest); + + $dest_directory = dirname ($dest_filename); + if (!exists ($OutDirs{$dest_directory})) + { + print "[ -d '$OutDir/$dest_directory' ] || mkdir -p '$OutDir/$dest_directory'\n"; + $OutDirs{$dest_directory} = 1; + } + print "./extractDS.px -i '$InDir/$orig_filename' -s 'rmerged' -s 'wmerged' -o '$OutDir/$dest_filename' -d 'read' -d 'write'\n"; $dest->{'type'} = 'disk_octets';