--- /usr/libexec/draksnapshot-config 2022-09-24 15:02:05.486309040 +0200 +++ /usr/libexec/draksnapshot-config.new 2022-09-24 16:55:35.273677503 +0200 @@ -153,6 +153,8 @@ my $is_enabled = to_bool(glob("/etc/cron.*/rsnapshot")); my ($box, $button); +my $box2; +my $is_backup_after_apply; gtkadd($my_win->{window}, gtknew('VBox', children => [ if_(!$::isEmbedded, 0, Gtk3::Banner->new('draksnapshot-big', @@ -207,7 +209,10 @@ $button = gtknew('Install_Button', text => N("Advanced"), clicked => sub { $d_window->show }), ]), - ]), + 0, $box2 = gtknew('VBox',children => [ + 0, gtknew('CheckButton', text => N("Perform first backup after apply (hourly type)"),active_ref => \$is_backup_after_apply + )]) + ]),, 0, gtknew('HButtonBox', layout => 'end', border_width => 5, spacing => 5, children_loose => [ gtknew('Button', text => N("Restore"), clicked => \&restore), gtknew('Button', text => N("Apply"), clicked => \&verif), @@ -376,6 +381,17 @@ uniq($where2snapshot, map { @$_[0] } @{$exclude_list->{data}})); save_keyword('snapshot_root', join("\t", 'snapshot_root', $where2snapshot)); generate_cron_entry(); + info_dialog(N("Information"),N("Parameters written/updated.\n You might click on the close button of the application to quit")); + if ($is_backup_after_apply){ + if (-e '/var/run/rsnapshot.pid') + { + err_dialog(N("Warning"),N("A backup is already running launching first backup is not possible.\nPlease try later")); + } + else{ + info_dialog(N("Information"),N("Request has been done to launch first backup. Launching it.")); + fork_exec('/usr/bin/rsnapshot hourly'); + } + } } sub fork_exec { @@ -384,7 +400,13 @@ } sub restore() { + if (-e '/var/run/rsnapshot.pid') + { + err_dialog(N("Warning"),N("A backup is already running.\nRestore is not possible.\nPlease try later")); + } + else{ fork_exec('/usr/sbin/draksnapshot-restore'); + } } sub save_keyword {