summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xperl-install/standalone/drakbackup55
1 files changed, 30 insertions, 25 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup
index ef62fe76f..fe75a6938 100755
--- a/perl-install/standalone/drakbackup
+++ b/perl-install/standalone/drakbackup
@@ -39,6 +39,12 @@
# cvs if version control of /etc directory
# cdrecord & mkisofs
#
+# cdrw: /sys/dev/cdrom/info
+# /scsi/host0/bus0/target4/lun0
+#
+# tar --use-compress-prog=bzip2 xf foo.tar.bz2
+
+
use Gtk;
use lib qw(/usr/lib/libDrakX );
@@ -52,8 +58,6 @@ my $in = 'interactive'->vnew('', 'default');
$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
!$::isEmbedded && $in->isa('interactive_gtk') and $::isWizard=1;
-
-
if ("@ARGV" =~ /--help|-h/) {
print q(Backup and monitoring application
@@ -320,15 +324,26 @@ sub return_path {
}
sub build_backup_files {
+
+#tar --use-compress-prog=bzip2 xf foo.tar.bz2
+
-d $save_path or mkdir_p($save_path);
my $path_name;
+ my $tar_cmd;
+ my $tar_ext;
my @list_other_;
+ if ($comp_mode) { $tar_cmd = "tar cv --use-compress-program /usr/bin/bzip2 "; $tar_ext = "tar.bz2" }
+ else { $tar_cmd = "tar cvz "; $tar_ext = "tar.gz"}
+ if ( $option_replace ) {
+ $comp_mode and system("cd $save_path && rm -f *.tar.gz");
+ $comp_mode or system("cd $save_path && rm -f *.tar.bz2");
+ }
if ($where_hd) {
print "backup_sys @sys_files\n";
- $backup_sys and system("tar cvfz $save_path/backup_sys.tar.gz @sys_files");
+ $backup_sys and system("$tar_cmd -f $save_path/backup_sys.$tar_ext @sys_files");
print "backup_other @list_other\n";
if (@list_other) {
- system("tar cvfz $save_path/backup_other.tar.gz @list_other");
+ system("$tar_cmd -f $save_path/backup_other.$tar_ext @list_other");
foreach (@list_other) {
push @list_other_, $_ . "\n";
}
@@ -338,8 +353,8 @@ sub build_backup_files {
foreach (@user_list) {
$path_name = return_path($_);
print "path of user: $path_name\n";
- $what_no_browser or system("tar cvfz $save_path/backup_user_$_.tar.gz $path_name");
- $what_no_browser and system("tar cvz --exclude NewCache --exclude Cache --exclude cache -f $save_path/backup_user_$_.tar.gz $path_name | grep cahe");
+ $what_no_browser or system("$tar_cmd -f $save_path/backup_user_$_.$tar_ext $path_name");
+ $what_no_browser and system("$tar_cmd --exclude NewCache --exclude Cache --exclude cache -f $save_path/backup_user_$_.$tar_ext $path_name");
}
}
}
@@ -370,8 +385,8 @@ sub interactive_mode {
if ($option_replace) { $box_cgf_state_replace = _("Replace backups (do not update)"),
} else { $box_cgf_state_replace = _("Update backups (do not replace)"), }
- if ($comp_mode) { $box_cgf_state_comp = _("Backups use tar and gunzip "),
- } else { $box_cgf_state_comp = _("Backups use tar and gunzip"), }
+ if ($comp_mode) { $box_cgf_state_comp = _("Backups use tar and bzip2 "),
+ } else { $box_cgf_state_comp = _("Backups use tar and gzip"), }
if ($cfg_file_exist) {
my $label_cfg_file = new Gtk::Label _("Backup Sources: \n-System Files: @sys_files \n-Users Files: @user_list\n-Other Files to backup: @list_other\nPath to save backups: $save_path\nOptions:\n$box_cgf_state_replace\n$box_cgf_state_comp\n\n");
@@ -628,7 +643,6 @@ sub advanced {
my $box_where_net = gtkpack_(new Gtk::VBox(0,1),
0, new Gtk::HSeparator,
0, my $check_where_net = new Gtk::CheckButton( _(" Use Network to backup") ),
-# 0, my $check_where_net_daemon = new Gtk::CheckButton( _(" Use Network with daemon") ),
0, new Gtk::HSeparator,
0, gtkpack_(new Gtk::HBox(0,10),
1, _("please choose your protocol"),
@@ -680,7 +694,7 @@ sub advanced {
my $box_where_hd = gtkpack_(new Gtk::VBox(0,1),
0, new Gtk::HSeparator,
0, my $check_where_hd = new Gtk::CheckButton( _(" Use Hard Disk to backup") ),
-# 0, my $check_where_hd_daemon = new Gtk::CheckButton( _(" Use Hard Disk with daemon") ),
+
0, new Gtk::HSeparator,
0, gtkpack_(new Gtk::HBox(0,10),
0, _(" "),
@@ -710,7 +724,7 @@ sub advanced {
my $box_where_cd = gtkpack_(new Gtk::VBox(0,1),
0, new Gtk::HSeparator,
0, my $check_where_cd = new Gtk::CheckButton( _(" Use CD/DVDROM to backup") ),
-# 0, my $check_where_cd_daemon = new Gtk::CheckButton( _(" Use CD/DVDROM with daemon") ),
+
0, new Gtk::HSeparator,
0, gtkpack_(new Gtk::HBox(0,10),
1, _("please choose your CD space"),
@@ -890,8 +904,6 @@ sub find_backup_to_restore {
}
sub do_cron {
-
-
}
sub do_restore_backend {
@@ -899,6 +911,7 @@ sub do_restore_backend {
$restore_sys and system("cd / && tar xvfz $save_path/backup_sys.tar.gz ");
$restore_other and system("cd / && tar xvfz $save_path/backup_other.tar.gz ");
+# decomp: bzcat nomdufichier.tar.bz2 | tar xv
}
sub do_restore {
@@ -914,14 +927,6 @@ sub do_restore {
),
1, new Gtk::VBox(0,10),
0, gtkpack_(new Gtk::HBox(0,10),
- 0, gtksignal_connect(new Gtk::Button(_(" Previous ")), clicked => sub {
- ${$central_widget}->destroy();
- restore_step2();
- }),
- 1, new Gtk::VBox(0,10),
- 0, gtksignal_connect(new Gtk::Button(_(" Next ")), clicked => sub {
- ${$central_widget}->destroy();
- }),
),
),
);
@@ -1195,8 +1200,8 @@ sub interactive_mode_my {
$backup_sys or $box_cgf_state_sys = _("Do not include System Files");
if ($option_replace) { $box_cgf_state_replace = _("Replace backups (do not update)"),
} else { $box_cgf_state_replace = _("Update backups (do not replace)"), }
- if ($comp_mode) { $box_cgf_state_comp = _("Backups use tar and gzip "),
- } else { $box_cgf_state_comp = _("Backups use tar and bzip"), }
+ if ($comp_mode) { $box_cgf_state_comp = _("Backups use tar and bzip2 "),
+ } else { $box_cgf_state_comp = _("Backups use tar and gzip"), }
if ($cfg_file_exist) { my $label_cfg_file = new Gtk::Label _("Backup Sources: \n-System Files: @sys_files \n-Users Files: @user_list\n-Other Files: @list_other\nPath to save backups: $save_path\nOptions:\n$box_cgf_state_replace\n$box_cgf_state_comp\n$box_cgf_state_sys\n");
$box_cfg_state = gtkpack(new Gtk::VBox( 0, 0),
gtkset_justify( $label_cfg_file , 'left'),
@@ -1297,8 +1302,8 @@ sub after_adv {
if ($option_replace) { $box_cgf_state_replace = _("Replace backups (do not update)"),
} else { $box_cgf_state_replace = _("Update backups (do not replace)"), }
- if ($comp_mode) { $box_cgf_state_comp = _("Backups use tar and gunzip "),
- } else { $box_cgf_state_comp = _("Backups use tar and gunzip"), }
+ if ($comp_mode) { $box_cgf_state_comp = _("Backups use tar and bzip2 "),
+ } else { $box_cgf_state_comp = _("Backups use tar and gzip"), }
if ($cfg_file_exist) {
my $label_cfg_file = new Gtk::Label _("Backup Sources: \n-System Files: @sys_files \n-Users Files: @user_list\n-Other Files to backup: @list_other\nPath to save backups: $save_path\nOptions:\n$box_cgf_state_replace\n$box_cgf_state_comp\n$box_cgf_state_sys\n");