diff --git a/src/freedombone-backup-local b/src/freedombone-backup-local index 4a6398b17bc1668bc28a2423c49779f0bf5a9904..55ceb0ffbfae1bea57432c46629b4e341742d1f0 100755 --- a/src/freedombone-backup-local +++ b/src/freedombone-backup-local @@ -41,6 +41,8 @@ if [ -f /usr/bin/${PROJECT_NAME} ]; then PROJECT_INSTALL_DIR=/usr/bin fi +backup_counter=0 + function please_wait { local str width height length @@ -211,6 +213,7 @@ function backup_users { fi gpg_agent_enable "$USERNAME" + increment_backup_progress fi done } @@ -388,12 +391,24 @@ if [[ "$backup_device" == "simple" || "$backup_device" == "detect" || "$backup_d fi fi +increment_backup_progress gpg_agent_setup root + +increment_backup_progress backup_mount_drive "$backup_device" "$2" + +increment_backup_progress remove_backup_directory "$remove_option" + +increment_backup_progress make_backup_directory + +increment_backup_progress check_storage_space_remaining + +increment_backup_progress backup_users + prepare_directories backup_directories backup_apps local diff --git a/src/freedombone-restore-local b/src/freedombone-restore-local index b55fbfc485006ecbf5db3abfadd7844da4543c53..b77e20b936692ca220035d5514357ce0d42d23f8 100755 --- a/src/freedombone-restore-local +++ b/src/freedombone-restore-local @@ -46,6 +46,8 @@ fi # MariaDB password DATABASE_PASSWORD=$(${PROJECT_NAME}-pass -u root -a mariadb) +restore_counter=0 + function please_wait { local str width height length diff --git a/src/freedombone-utils-backup b/src/freedombone-utils-backup index fa250c1aae640bd79b553ed6f520feccd317414a..ad1637435a9b9760b0fb51ef7eba47c1656b5c98 100755 --- a/src/freedombone-utils-backup +++ b/src/freedombone-utils-backup @@ -39,6 +39,9 @@ BACKUP_GPG_OPTIONS="--pinentry-mode loopback" # This is used to detect drives later connected DRIVES_BASELINE_FILE=/root/.drives_baseline +backup_progress_file=/root/.backup_progress.txt + + function create_backups_temp_directory { if [ ! -d $BACKUP_TEMP_DIRECTORY ]; then mkdir $BACKUP_TEMP_DIRECTORY @@ -315,6 +318,16 @@ function backup_directory_to_usb_duplicity { remove_backups_temp_directory } +function increment_backup_progress { + backup_counter=$((backup_counter + 1)) + echo -n "$backup_counter" > "$backup_progress_file" +} + +function increment_restore_progress { + restore_counter=$((restore_counter + 1)) + echo -n "$restore_counter" > "$restore_progress_file" +} + function backup_directory_to_usb { if [ ! -d "${1}" ]; then echo $"WARNING: directory does not exist: ${1}" @@ -338,6 +351,8 @@ function backup_directory_to_usb { if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then rm -rf "${1}" fi + + increment_backup_progress fi } @@ -366,6 +381,7 @@ function restore_directory_from_usb { mkdir "${1}" fi restore_directory_from_usb_duplicity "${1}" "${2}" + increment_restore_progress } function restore_directory_from_friend_duplicity { @@ -397,6 +413,8 @@ function backup_database_to_usb { echo $"Error backing up ${1} database to ${local_database_dir}/${1}.sql" exit 62383 fi + increment_backup_progress + backup_directory_to_usb "${local_database_dir}" "${database_name}data" }