Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
e876501d
Commit
e876501d
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Increment counters during backup and restore
parent
b6bfb77e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-backup-local
+15
-0
15 additions, 0 deletions
src/freedombone-backup-local
src/freedombone-restore-local
+2
-0
2 additions, 0 deletions
src/freedombone-restore-local
src/freedombone-utils-backup
+18
-0
18 additions, 0 deletions
src/freedombone-utils-backup
with
35 additions
and
0 deletions
src/freedombone-backup-local
+
15
−
0
View file @
e876501d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-restore-local
+
2
−
0
View file @
e876501d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-backup
+
18
−
0
View file @
e876501d
...
...
@@ -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"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment