2014-09-01 13:06:38 +00:00
< style >
2014-09-08 20:09:18 +00:00
#backup-status th { text-align: center; }
2014-09-01 13:06:38 +00:00
#backup-status tr.full-backup td { font-weight: bold; }
< / style >
< h2 > Backup Status< / h2 >
< h3 > Copying Backup Files< / h3 >
2014-09-08 20:12:31 +00:00
< p > The box makes an incremental backup each night. The backup is stored on the machine itself. You are responsible for copying the backup files off of the machine.< / p >
< p > Many cloud providers make this easy by allowing you to take snapshots of the machine's disk.< / p >
2015-05-25 00:45:57 +00:00
< p > You can also use SFTP (FTP over SSH) to copy files from < tt id = "backup-location" > < / tt > . These files are encrypted, so they are safe to store anywhere. Copy the encryption password from < tt id = "backup-encpassword-file" > < / tt > also but keep it in a safe location.< / p >
2014-09-01 13:06:38 +00:00
< h3 > Current Backups< / h3 >
2015-03-08 20:55:39 +00:00
< p > The backup directory currently contains the backups listed below. The total size on disk of the backups is currently < span id = "backup-total-size" > < / span > .< / p >
2014-09-01 13:06:38 +00:00
< table id = "backup-status" class = "table" style = "width: auto" >
< thead >
< th colspan = "2" > When< / th >
< th > Type< / th >
< th > Size< / th >
2014-09-08 20:09:18 +00:00
< th > Deleted in...< / th >
2014-09-01 13:06:38 +00:00
< / thead >
< tbody >
< / tbody >
< / table >
< script >
function nice_size(bytes) {
var powers = ['bytes', 'KB', 'MB', 'GB', 'TB'];
while (true) {
if (powers.length == 1) break;
if (bytes < 1000 ) break ;
bytes /= 1024;
powers.shift();
}
2014-10-07 20:24:11 +00:00
// round to have three significant figures but at most one decimal place
if (bytes >= 100)
bytes = Math.round(bytes)
else
bytes = Math.round(bytes*10)/10;
return bytes + " " + powers[0];
2014-09-01 13:06:38 +00:00
}
function show_system_backup() {
$('#backup-status tbody').html("< tr > < td colspan = '2' class = 'text-muted' > Loading...< / td > < / tr > ")
api(
"/system/backup/status",
"GET",
{ },
function(r) {
2015-03-26 12:27:26 +00:00
$('#backup-location').text(r.directory);
2014-09-01 13:06:38 +00:00
$('#backup-encpassword-file').text(r.encpwfile);
$('#backup-status tbody').html("");
var total_disk_size = 0;
2014-10-15 16:31:08 +00:00
if (r.backups.length == 0) {
var tr = $('< tr > < td colspan = "3" > No backups have been made yet.< / td > < / tr > ');
$('#backup-status tbody').append(tr);
}
2014-09-01 13:06:38 +00:00
for (var i = 0; i < r.backups.length ; i + + ) {
var b = r.backups[i];
var tr = $('< tr / > ');
if (b.full) tr.addClass("full-backup");
tr.append( $('< td / > ').text(b.date_str + " " + r.tz) );
tr.append( $('< td / > ').text(b.date_delta + " ago") );
2014-09-08 20:09:18 +00:00
tr.append( $('< td / > ').text(b.full ? "full" : "increment") );
2015-03-26 12:27:26 +00:00
tr.append( $('< td style = "text-align: right" / > ').text( nice_size(b.size)) );
2014-09-08 20:09:18 +00:00
if (b.deleted_in)
tr.append( $('< td / > ').text(b.deleted_in) );
else
2015-03-08 20:55:39 +00:00
tr.append( $('< td class = "text-muted" > unknown< / td > ') );
2014-09-01 13:06:38 +00:00
$('#backup-status tbody').append(tr);
total_disk_size += b.size;
}
$('#backup-total-size').text(nice_size(total_disk_size));
})
}
< / script >