#!/usr/bin/perl # Show a form for restoring an old backup job require './bacula-backup-lib.pl'; &ui_print_header(undef, $text{'restore_title'}, "", "restore"); $conf = &get_director_config(); @jobs = &find("Job", $conf); $backup = &find_by("Type", "Restore", \@jobs); print &ui_form_start("restore.cgi", "post"); print &ui_table_start($text{'restore_header'}, undef, 2); # Old job to restore $dbh = &connect_to_database(); $cmd = $dbh->prepare("select JobId,Name,SchedTime,Level from Job where Name not like 'Restore%' order by SchedTime desc") || &error("prepare failed : ",$dbh->errstr); $cmd->execute(); while(my ($id, $name, $when, $level) = $cmd->fetchrow()) { $level = $text{'restore_level_'.$level} || $level; ($j, $c) = &is_oc_object($name); if (!$j) { # Normal backup push(@opts, [ $id, "$id - $name ($when) - $level" ]); } elsif ($j && $c) { # Backup of one node push(@opts, [ $id, "$id - $j on $c ($when) - $level" ]); # Save the job ID to a list of those for this particular node # group backup $stime = &date_to_unix($when); $found = 0; foreach $nj (@nodejobs) { $diff = abs($stime - $nj->{'stime'}); if ($nj->{'job'} eq $j && $diff < 30) { push(@{$nj->{'clients'}}, [ $id, $c ]); $found = 1; last; } } if (!$found) { push(@nodejobs, { 'job' => $j, 'stime' => $stime, 'when' => $when, 'clients' => [ [ $id, $c ] ]}); } } } # Add entries for entire node group restores if (@nodejobs) { @opts = ( [ undef, $text{'restore_jlist'} ], @opts, [ undef, $text{'restore_njlist'} ] ); foreach $nj (@nodejobs) { push(@opts, [ "nj_".$nj->{'job'}."_".$nj->{'stime'}."_". $nj->{'clients'}->[0]->[0], "$nj->{'job'} ($nj->{'when'}" ]); } } $cmd->finish(); print &ui_table_row($text{'restore_job'}, &ui_select("job", undef, \@opts)); # Files to restore print &ui_table_row($text{'restore_files'}, &ui_textarea("files", undef, 8, 50)."\n". &bacula_file_button("files", "job")); # Storage device @storages = sort { lc($a->{'name'}) cmp lc($b->{'name'}) } &get_bacula_storages(); print &ui_table_row($text{'restore_storage'}, &ui_select("storage", undef, [ map { [ $_->{'name'}, &text('storagestatus_on', $_->{'name'}, $_->{'address'}) ] } @storages ])); # Destination client or group @clients = sort { lc($a->{'name'}) cmp lc($b->{'name'}) } grep { !&is_oc_object($_, 1) } &get_bacula_clients(); @groups = sort { lc($a->{'name'}) cmp lc($b->{'name'}) } grep { &is_oc_object($_, 1) } &get_bacula_clients(); @opts = ( ); if (@clients) { push(@opts, [ undef, $text{'restore_clist'} ]) if (@groups); push(@opts, map { [ $_->{'name'}, &text('clientstatus_on', $_->{'name'}, $_->{'address'}) ] } @clients); } if (@groups) { push(@opts, [ undef, $text{'restore_glist'} ]) if (@clients); push(@opts, map { ($g, $c) = &is_oc_object($_); $c ? ( ) : ( [ $_->{'name'}, $g ] ) } @groups); } if (@nodejobs) { push(@opts, [ "*", $text{'restore_all'} ]); } print &ui_table_row($text{'restore_client'}, &ui_select("client", undef, \@opts)); # Destination directory $where = &find_value("Where", $backup->{'members'}); print &ui_table_row($text{'restore_where'}, &ui_opt_textbox("where", undef, 40, $text{'default'}." (<tt>$where</tt>)<br>", $text{'restore_where2'})); # Wait for completion? print &ui_table_row($text{'backup_wait'}, &ui_yesno_radio("wait", $config{'wait'})); print &ui_table_end(); print &ui_form_end([ [ "restore", $text{'restore_ok'} ] ]); &ui_print_footer("", $text{'index_return'});
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
help | Folder | 0755 |
|
|
images | Folder | 0755 |
|
|
jstree | Folder | 0755 |
|
|
lang | Folder | 0755 |
|
|
CHANGELOG | File | 1.06 KB | 0644 |
|
Makefile | File | 130 B | 0644 |
|
apply.cgi | File | 214 B | 0755 |
|
backup.cgi | File | 1.76 KB | 0755 |
|
backup_config.pl | File | 600 B | 0644 |
|
backup_form.cgi | File | 806 B | 0755 |
|
bacula-backup-lib.pl | File | 43.51 KB | 0755 |
|
bootup.cgi | File | 363 B | 0755 |
|
cancel_jobs.cgi | File | 674 B | 0755 |
|
clientstatus_form.cgi | File | 2.51 KB | 0755 |
|
config | File | 138 B | 0644 |
|
config-syno-linux | File | 136 B | 0644 |
|
config-windows | File | 151 B | 0644 |
|
config.info | File | 871 B | 0644 |
|
config.info.ca | File | 1.02 KB | 0644 |
|
config.info.de | File | 947 B | 0644 |
|
config.info.fr | File | 0 B | 0644 |
|
config.info.ms | File | 1019 B | 0644 |
|
config.info.nl | File | 872 B | 0644 |
|
config.info.no | File | 951 B | 0644 |
|
config.info.pl | File | 998 B | 0644 |
|
config.info.pt_BR | File | 0 B | 0644 |
|
config.info.ru | File | 1.17 KB | 0644 |
|
delete_clients.cgi | File | 749 B | 0755 |
|
delete_devices.cgi | File | 650 B | 0755 |
|
delete_fdirectors.cgi | File | 653 B | 0755 |
|
delete_filesets.cgi | File | 761 B | 0755 |
|
delete_gjobs.cgi | File | 830 B | 0755 |
|
delete_groups.cgi | File | 917 B | 0755 |
|
delete_jobs.cgi | File | 735 B | 0755 |
|
delete_pools.cgi | File | 732 B | 0755 |
|
delete_schedules.cgi | File | 773 B | 0755 |
|
delete_sdirectors.cgi | File | 666 B | 0755 |
|
delete_storages.cgi | File | 768 B | 0755 |
|
delete_volumes.cgi | File | 566 B | 0755 |
|
dirstatus_form.cgi | File | 2.3 KB | 0755 |
|
edit_client.cgi | File | 2.51 KB | 0755 |
|
edit_device.cgi | File | 2.2 KB | 0755 |
|
edit_director.cgi | File | 1.46 KB | 0755 |
|
edit_fdirector.cgi | File | 1.4 KB | 0755 |
|
edit_file.cgi | File | 1.11 KB | 0755 |
|
edit_fileset.cgi | File | 2.31 KB | 0755 |
|
edit_gjob.cgi | File | 4.41 KB | 0755 |
|
edit_group.cgi | File | 2.56 KB | 0755 |
|
edit_job.cgi | File | 5.34 KB | 0755 |
|
edit_pool.cgi | File | 2.62 KB | 0755 |
|
edit_schedule.cgi | File | 2.08 KB | 0755 |
|
edit_sdirector.cgi | File | 1.4 KB | 0755 |
|
edit_storage.cgi | File | 2.86 KB | 0755 |
|
edit_storagec.cgi | File | 1.25 KB | 0755 |
|
fixaddr.cgi | File | 481 B | 0755 |
|
fixpass.cgi | File | 513 B | 0755 |
|
gbackup.cgi | File | 1.59 KB | 0755 |
|
index.cgi | File | 6.13 KB | 0755 |
|
install_check.pl | File | 450 B | 0755 |
|
label.cgi | File | 1.49 KB | 0755 |
|
label_form.cgi | File | 974 B | 0755 |
|
list.cgi | File | 3.21 KB | 0755 |
|
list_clients.cgi | File | 1.29 KB | 0755 |
|
list_devices.cgi | File | 1.27 KB | 0755 |
|
list_fdirectors.cgi | File | 1.34 KB | 0755 |
|
list_filesets.cgi | File | 1.31 KB | 0755 |
|
list_gbackup.cgi | File | 814 B | 0755 |
|
list_gjobs.cgi | File | 1.52 KB | 0755 |
|
list_grestore.cgi | File | 1.62 KB | 0755 |
|
list_groups.cgi | File | 1.78 KB | 0755 |
|
list_jobs.cgi | File | 1.68 KB | 0755 |
|
list_pools.cgi | File | 1.23 KB | 0755 |
|
list_schedules.cgi | File | 1.26 KB | 0755 |
|
list_sdirectors.cgi | File | 1.34 KB | 0755 |
|
list_storages.cgi | File | 1.39 KB | 0755 |
|
list_sync.cgi | File | 795 B | 0755 |
|
log_parser.pl | File | 1000 B | 0755 |
|
manual.sxw | File | 24.8 KB | 0644 |
|
module.info | File | 194 B | 0644 |
|
module.info.af | File | 0 B | 0644 |
|
module.info.af.auto | File | 146 B | 0644 |
|
module.info.ar | File | 0 B | 0644 |
|
module.info.ar.auto | File | 279 B | 0644 |
|
module.info.be | File | 0 B | 0644 |
|
module.info.be.auto | File | 291 B | 0644 |
|
module.info.bg | File | 0 B | 0644 |
|
module.info.bg.auto | File | 236 B | 0644 |
|
module.info.ca | File | 193 B | 0644 |
|
module.info.cs | File | 0 B | 0644 |
|
module.info.cs.auto | File | 173 B | 0644 |
|
module.info.da | File | 0 B | 0644 |
|
module.info.da.auto | File | 171 B | 0644 |
|
module.info.de | File | 167 B | 0644 |
|
module.info.el | File | 0 B | 0644 |
|
module.info.el.auto | File | 338 B | 0644 |
|
module.info.es | File | 0 B | 0644 |
|
module.info.es.auto | File | 173 B | 0644 |
|
module.info.eu | File | 0 B | 0644 |
|
module.info.eu.auto | File | 161 B | 0644 |
|
module.info.fa | File | 0 B | 0644 |
|
module.info.fa.auto | File | 271 B | 0644 |
|
module.info.fi | File | 0 B | 0644 |
|
module.info.fi.auto | File | 196 B | 0644 |
|
module.info.fr | File | 0 B | 0644 |
|
module.info.fr.auto | File | 186 B | 0644 |
|
module.info.he | File | 0 B | 0644 |
|
module.info.he.auto | File | 205 B | 0644 |
|
module.info.hr | File | 0 B | 0644 |
|
module.info.hr.auto | File | 164 B | 0644 |
|
module.info.hu | File | 0 B | 0644 |
|
module.info.hu.auto | File | 202 B | 0644 |
|
module.info.it | File | 0 B | 0644 |
|
module.info.it.auto | File | 155 B | 0644 |
|
module.info.ja | File | 0 B | 0644 |
|
module.info.ja.auto | File | 230 B | 0644 |
|
module.info.ko | File | 0 B | 0644 |
|
module.info.ko.auto | File | 182 B | 0644 |
|
module.info.lt | File | 0 B | 0644 |
|
module.info.lt.auto | File | 194 B | 0644 |
|
module.info.lv | File | 0 B | 0644 |
|
module.info.lv.auto | File | 161 B | 0644 |
|
module.info.ms | File | 172 B | 0644 |
|
module.info.mt | File | 0 B | 0644 |
|
module.info.mt.auto | File | 156 B | 0644 |
|
module.info.nl | File | 30 B | 0644 |
|
module.info.nl.auto | File | 127 B | 0644 |
|
module.info.no | File | 28 B | 0644 |
|
module.info.no.auto | File | 136 B | 0644 |
|
module.info.pl | File | 186 B | 0644 |
|
module.info.pt | File | 0 B | 0644 |
|
module.info.pt.auto | File | 165 B | 0644 |
|
module.info.pt_BR | File | 0 B | 0644 |
|
module.info.pt_BR.auto | File | 171 B | 0644 |
|
module.info.ro | File | 0 B | 0644 |
|
module.info.ro.auto | File | 175 B | 0644 |
|
module.info.ru | File | 0 B | 0644 |
|
module.info.ru.auto | File | 336 B | 0644 |
|
module.info.sk | File | 0 B | 0644 |
|
module.info.sk.auto | File | 183 B | 0644 |
|
module.info.sl | File | 0 B | 0644 |
|
module.info.sl.auto | File | 154 B | 0644 |
|
module.info.sv | File | 0 B | 0644 |
|
module.info.sv.auto | File | 171 B | 0644 |
|
module.info.th | File | 0 B | 0644 |
|
module.info.th.auto | File | 361 B | 0644 |
|
module.info.tr | File | 0 B | 0644 |
|
module.info.tr.auto | File | 201 B | 0644 |
|
module.info.uk | File | 0 B | 0644 |
|
module.info.uk.auto | File | 289 B | 0644 |
|
module.info.ur | File | 0 B | 0644 |
|
module.info.ur.auto | File | 269 B | 0644 |
|
module.info.vi | File | 0 B | 0644 |
|
module.info.vi.auto | File | 200 B | 0644 |
|
module.info.zh | File | 0 B | 0644 |
|
module.info.zh.auto | File | 127 B | 0644 |
|
module.info.zh_TW | File | 0 B | 0644 |
|
module.info.zh_TW.auto | File | 133 B | 0644 |
|
mount.cgi | File | 916 B | 0755 |
|
mount_form.cgi | File | 885 B | 0755 |
|
poolstatus_form.cgi | File | 1.96 KB | 0755 |
|
restart.cgi | File | 196 B | 0755 |
|
restore.cgi | File | 4.99 KB | 0755 |
|
restore_form.cgi | File | 3.53 KB | 0755 |
|
save_client.cgi | File | 2.42 KB | 0755 |
|
save_device.cgi | File | 2.04 KB | 0755 |
|
save_director.cgi | File | 1.15 KB | 0755 |
|
save_fdirector.cgi | File | 1.57 KB | 0755 |
|
save_file.cgi | File | 1.01 KB | 0755 |
|
save_fileset.cgi | File | 2.7 KB | 0755 |
|
save_gjob.cgi | File | 2.93 KB | 0755 |
|
save_group.cgi | File | 2.33 KB | 0755 |
|
save_job.cgi | File | 2.91 KB | 0755 |
|
save_pool.cgi | File | 2.36 KB | 0755 |
|
save_schedule.cgi | File | 1.76 KB | 0755 |
|
save_sdirector.cgi | File | 1.57 KB | 0755 |
|
save_storage.cgi | File | 2.43 KB | 0755 |
|
save_storagec.cgi | File | 1.07 KB | 0755 |
|
save_sync.cgi | File | 737 B | 0755 |
|
schedule_chooser.cgi | File | 2.89 KB | 0755 |
|
schedule_select.cgi | File | 928 B | 0755 |
|
start.cgi | File | 187 B | 0755 |
|
stop.cgi | File | 183 B | 0755 |
|
storagestatus_form.cgi | File | 2.57 KB | 0755 |
|
sync.pl | File | 408 B | 0755 |
|
treechooser.cgi | File | 2.03 KB | 0755 |
|