Commit b01d75ea authored by Efthymia Bika's avatar Efthymia Bika

Add full/incremental backup type options

parent f4d8461c
......@@ -18,7 +18,8 @@
} else {
populate_clouds("");
}
if(typeof selected_backup != 'undefined' && selected_backup) {
if(typeof selected_backup != 'undefined' && selected_backup &&
typeof backups[selected_backup] != 'undefined') {
$("#selected-bar").html(selected_backup);
$("#selected-bar").show();
load_backup(backups[selected_backup]);
......@@ -27,8 +28,16 @@
disable_buttons(true);
$("#loader").show();
}
if(typeof backups[selected_backup].first_backup != 'undefined') {
$("#inc").prop("checked", true);
} else {
$("#full").prop("checked", true);
$("#inc").prop("disabled", true);
}
} else {
$("#selected-bar").hide();
$("#inc").prop("disabled", true);
load_backup();
}
......@@ -245,6 +254,19 @@
</div>
</fieldset>
<fieldset>
<div class="clearfix">
<div class="small-3 columns">
<label id="backup-type-label" for="backup-type" class="right inline">
Backup Type
</label>
</div>
<div class="small-9 columns">
<input type="radio" name="backup-type" value="full" id="full" checked="checked">
<label for="full">Full</label>
<input type="radio" name="backup-type" value="incremental" id="inc">
<label for="inc">Incremental</label>
</div>
</div>
<div class="clearfix">
<div class="small-3 columns">
<label id="exclude-label" for="exclude" class="right inline">
......
......@@ -81,6 +81,8 @@ function load_backup(backup) {
$("#passphrase").val('');
$("#exclude").val('');
$("#include").val('');
$("#full").prop("checked", true);
$("#inc").prop("disabled", true);
disable_form(false);
disable_actions(true);
}
......
......@@ -76,6 +76,12 @@ function run_duplicity(restore, force) {
}
}
var type_arg = "";
if(!restore) {
var backup_type = $("input[name=backup-type]:checked").val();
type_arg = " " + backup_type + " ";
}
var exclude_arg = "";
if(!restore) {
var exclude = $("#exclude").val();
......@@ -213,7 +219,7 @@ function run_duplicity(restore, force) {
dirs = " swift://" + container_name + " " + directory;
}
var cmd = build_win_commands();
var dup_cmd = DUPLICITY_PATH + " " + force_arg + include_arg +
var dup_cmd = DUPLICITY_PATH + " " + type_arg + force_arg + include_arg +
exclude_arg + file_arg + time_arg + dirs + ";";
exec(CYGWIN_BASH + " -c '" + cmd + dup_cmd + "'", dup_output);
......@@ -225,7 +231,7 @@ function run_duplicity(restore, force) {
if(restore) {
dirs = " swift://" + container_name + " " + directory;
}
var dup_cmd = DUPLICITY_PATH + " " + force_arg + dup_verbosity + log_arg +
var dup_cmd = DUPLICITY_PATH + " " + type_arg + force_arg + dup_verbosity + log_arg +
include_arg + exclude_arg + file_arg + time_arg + dirs + ";";
exec(dup_cmd , dup_output);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment