Skip to content
Snippets Groups Projects
Commit 62a06815 authored by Bob Mottram's avatar Bob Mottram
Browse files

Log automatic backups

parent 71cf2889
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,9 @@ backup_progress_file=/root/.backup_progress.txt
restore_progress_file=/root/.restore_progress.txt
format_progress_file=/root/.format_progress.txt
# whether an automatically scheduled backup is running
running_auto_backup=
function app_not_on_onion_only {
app_name="$1"
......@@ -1027,6 +1030,7 @@ function initiate_automatic_backup {
if [[ "$curr_hour" == "$backup_hour" ]]; then
if [[ "$webadmin_prev_hour" != "$backup_hour" ]]; then
touch "$backup_file"
running_auto_backup=1
fi
fi
webadmin_prev_hour=$curr_hour
......@@ -1178,8 +1182,15 @@ function backup_and_restore {
backup_failed_message=$"Backup failed. See http://${HOSTNAME}/admin/backup.txt for details"
backup_success_message=$"Backup succeeded"
backup_name='webadmin'
if [ $running_auto_backup ]; then
backup_name=$'scheduled'
date >> "$webadmin_install_dir/autobackup.log"
running_auto_backup=
fi
check_for_existing_processes $backup_script
{ echo "echo \"Beginning webadmin backup \$(date)\" > $webadmin_install_dir/backup.txt";
{ echo "echo \"Beginning $backup_name backup \$(date)\" > $webadmin_install_dir/backup.txt";
echo "chown www-data:www-data $webadmin_install_dir/backup.txt";
echo '';
echo "cp $webadmin_install_dir/backup_progress_template.html $webadmin_install_dir/backup_progress.html";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment