summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-04-19 13:08:08 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-04-19 13:08:08 +0000
commit85e2e169a80005007d0b2db8050e3c8a97adad65 (patch)
tree6e8ec25285f2f08bb7e77a998436989ce30c2d67 /rescue
parent3da965926a96bd88eb40e48b02f74e8c3c37b283 (diff)
downloaddrakx-backup-do-not-use-85e2e169a80005007d0b2db8050e3c8a97adad65.tar
drakx-backup-do-not-use-85e2e169a80005007d0b2db8050e3c8a97adad65.tar.gz
drakx-backup-do-not-use-85e2e169a80005007d0b2db8050e3c8a97adad65.tar.bz2
drakx-backup-do-not-use-85e2e169a80005007d0b2db8050e3c8a97adad65.tar.xz
drakx-backup-do-not-use-85e2e169a80005007d0b2db8050e3c8a97adad65.zip
- ".lst" makes the file hidden, use "lst" instead
- default timeout is much too short
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/partimage_whole_disk17
1 files changed, 11 insertions, 6 deletions
diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk
index 7d36e9cfb..309883d36 100755
--- a/rescue/partimage_whole_disk
+++ b/rescue/partimage_whole_disk
@@ -40,9 +40,9 @@ sub save_all() {
foreach (@$part_list) {
$_->{saved} = !member($_->{fs_type}, 'ntfs', 'vfat', 'swap');
if ($_->{saved}) {
- run_program::run_or_die(@partimage_cmd,
- '-V', 0, '--nombr', '--nodesc', '--nocheck', '-b', '-o',
- 'save', devices::make($_->{device}), "$dir/$_->{device}");
+ run_or_die(@partimage_cmd,
+ '-V', 0, '--nombr', '--nodesc', '--nocheck', '-b', '-o',
+ 'save', devices::make($_->{device}), "$dir/$_->{device}");
}
}
save_part_list($part_list);
@@ -105,7 +105,7 @@ sub rest_all() {
#- restore from partimage
foreach (@$from_partimage) {
- run_program::run_or_die(@partimage_cmd, 'restore', '-b', devices::make($_->{device}), "$dir/$_->{device}");
+ run_or_die(@partimage_cmd, 'restore', '-b', devices::make($_->{device}), "$dir/$_->{device}");
}
foreach (@$created) {
@@ -121,13 +121,18 @@ sub save_part_list {
my @l = map { join(' ', @$_{lst_fields()}) } @$part_list;
log::l("save_part_list: $_") foreach @l;
my $partimage = join(' ', @partimage_cmd);
- open(my $F, "| $partimage -z0 -Bfoo=bar -o save_file $dir/.lst");
+ open(my $F, "| $partimage -z0 -Bfoo=bar -o save_file $dir/lst");
print $F "$_\n" foreach @l;
}
sub read_part_list() {
my $partimage = join(' ', @partimage_cmd);
- open(my $F, "$partimage -z0 -Bfoo=bar rest_file $dir/.lst |");
+ open(my $F, "$partimage -z0 -Bfoo=bar rest_file $dir/lst |");
my @l = chomp_(cat__($F));
log::l("read_part_list: $_") foreach @l;
[ map { my %l; @l{lst_fields()} = split; \%l } @l ];
}
+
+sub run_or_die {
+ my (@l) = @_;
+ run_program::raw({ timeout => 4 * 60 * 60 }, @l) or die join(' ', @l) . " failed\n";
+}