[ADIF Backup] Added unique name to the backup file.

This commit is contained in:
Andreas
2023-05-01 17:21:20 +02:00
parent b45cfda3eb
commit ebe01d938c
2 changed files with 5 additions and 2 deletions

View File

@@ -29,7 +29,9 @@ class Backup extends CI_Controller {
$data['qsos'] = $this->adif_data->export_all($key);
if ( ! write_file('backup/logbook.adi', $this->load->view('backup/exportall', $data, true)))
$data['filename'] = 'backup/logbook'. date('_Y_m_d_H_i_s') .'.adi';
if ( ! write_file($data['filename'], $this->load->view('backup/exportall', $data, true)))
{
$data['status'] = false;
}
@@ -39,6 +41,7 @@ class Backup extends CI_Controller {
}
$data['page_title'] = "ADIF - Backup";
$this->load->view('interface_assets/header', $data);
$this->load->view('backup/adif_view');

View File

@@ -4,7 +4,7 @@
<?php if($status == true) { ?>
<p>The backup of your log completed successfully. The output can be found at: <a href="<?php echo base_url(); ?>backup/logbook.adi"><?php echo base_url(); ?>backup/logbook.adi</a></a></p>
<p>The backup of your log completed successfully. The output can be found at: <a href="<?php echo base_url(); ?>backup/logbook.adi"><?php echo base_url() . $filename; ?></a></a></p>
<p>You could automate this process by making it a cronjob.</p>