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
a14ac0ff
Commit
a14ac0ff
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Deprecate obnam backup functions
parent
268c1dfc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-rss
+6
-0
6 additions, 0 deletions
src/freedombone-app-rss
src/freedombone-utils-backup
+0
-88
0 additions, 88 deletions
src/freedombone-utils-backup
with
6 additions
and
88 deletions
src/freedombone-app-rss
+
6
−
0
View file @
a14ac0ff
...
...
@@ -151,6 +151,9 @@ function backup_local_rss {
if
[
-d
/etc/share/tt-rss
]
;
then
echo
$"Backing up ttrss"
function_check get_mariadb_password
get_mariadb_password
function_check backup_database_to_usb
backup_database_to_usb ttrss
...
...
@@ -222,6 +225,9 @@ function backup_remote_rss {
function_check suspend_site
suspend_site ttrss
function_check get_mariadb_password
get_mariadb_password
function_check backup_database_to_friend
backup_database_to_friend ttrss
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-backup
+
0
−
88
View file @
a14ac0ff
...
...
@@ -279,14 +279,6 @@ function backup_database_local_usb {
echo
$"Database dump was created for
${
1
}
"
}
function
set_obnam_client_name
{
# obnam can backup multiple machines with different domain names to
# a repository. To be able to restore directories from different
# machines we need to enforce a single client name for all backups
echo
'[config]'
>
/etc/obnam.conf
echo
"client-name =
${
PROJECT_NAME
}
"
>>
/etc/obnam.conf
}
function
backup_directory_to_usb_duplicity
{
create_backups_temp_directory
echo
"
$BACKUP_DUMMY_PASSWORD
"
| duplicity full
--gpg-options
"
$BACKUP_GPG_OPTIONS
"
--tempdir
$BACKUP_TEMP_DIRECTORY
--encrypt-key
$MY_BACKUP_KEY_ID
--full-if-older-than
4W
--exclude-other-filesystems
${
1
}
file://
$USB_MOUNT
/backup/
${
2
}
...
...
@@ -320,38 +312,6 @@ function backup_directory_to_usb_duplicity {
remove_backups_temp_directory
}
function
backup_directory_to_usb_obnam
{
set_obnam_client_name
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam force-lock
-r
$USB_MOUNT
/backup/
${
2
}
--encrypt-with
$MY_BACKUP_KEY_ID
${
1
}
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam backup
-r
$USB_MOUNT
/backup/
${
2
}
--encrypt-with
$MY_BACKUP_KEY_ID
${
1
}
if
[[
$ENABLE_BACKUP_VERIFICATION
==
"yes"
]]
;
then
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam verify
-r
$USB_MOUNT
/backup/
${
2
}
--encrypt-with
$MY_BACKUP_KEY_ID
${
1
}
if
[
!
"
$?
"
=
"0"
]
;
then
umount
$USB_MOUNT
rm
-rf
$USB_MOUNT
if
[[
${
1
}
==
"/root/temp"
*
||
${
1
}
==
*
"tempbackup"
]]
;
then
shred
-zu
${
1
}
/
*
rm
-rf
${
1
}
fi
function_check restart_site
restart_site
exit
683252
fi
fi
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam forget
--keep
=
30d
-r
$USB_MOUNT
/backup/
${
2
}
--encrypt-with
$MY_BACKUP_KEY_ID
if
[
!
"
$?
"
=
"0"
]
;
then
umount
$USB_MOUNT
rm
-rf
$USB_MOUNT
if
[[
${
1
}
==
"/root/temp"
*
||
${
1
}
==
*
"tempbackup"
]]
;
then
shred
-zu
${
1
}
/
*
rm
-rf
${
1
}
fi
function_check restart_site
restart_site
exit
7
fi
}
function
backup_directory_to_usb
{
if
[
!
-d
${
1
}
]
;
then
echo
$"WARNING: directory does not exist:
${
1
}
"
...
...
@@ -370,7 +330,6 @@ function backup_directory_to_usb {
fi
backup_directory_to_usb_duplicity
${
1
}
${
2
}
#backup_directory_to_usb_obnam ${1} ${2}
if
[[
${
1
}
==
"/root/temp"
*
||
${
1
}
==
*
"tempbackup"
]]
;
then
shred
-zu
${
1
}
/
*
...
...
@@ -379,11 +338,6 @@ function backup_directory_to_usb {
fi
}
function
restore_directory_from_usb_obnam
{
set_obnam_client_name
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam restore
-r
$USB_MOUNT
/backup/
${
2
}
--to
${
1
}
}
function
restore_directory_from_usb_duplicity
{
create_backups_temp_directory
PASSPHRASE
=
"
$BACKUP_DUMMY_PASSWORD
"
duplicity restore
--gpg-options
"
$BACKUP_GPG_OPTIONS
"
--tempdir
$BACKUP_TEMP_DIRECTORY
--force
file://
$USB_MOUNT
/backup/
${
2
}
${
1
}
...
...
@@ -409,12 +363,6 @@ function restore_directory_from_usb {
mkdir
${
1
}
fi
restore_directory_from_usb_duplicity
${
1
}
${
2
}
#restore_directory_from_usb_obnam ${1} ${2}
}
function
restore_directory_from_friend_obnam
{
set_obnam_client_name
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam restore
-r
$SERVER_DIRECTORY
/backup/
${
2
}
--to
${
1
}
}
function
restore_directory_from_friend_duplicity
{
...
...
@@ -426,12 +374,10 @@ function restore_directory_from_friend_duplicity {
function
restore_directory_from_friend
{
if
[
!
${
1
}
]
;
then
echo
"obnam restore -r
$SERVER_DIRECTORY
/backup/
${
2
}
--to
${
1
}
"
echo
$'No restore destination given'
return
fi
if
[
!
${
2
}
]
;
then
echo
"obnam restore -r
$SERVER_DIRECTORY
/backup/
${
2
}
--to
${
1
}
"
echo
$'No restore source given'
return
fi
...
...
@@ -439,7 +385,6 @@ function restore_directory_from_friend {
mkdir
${
1
}
fi
restore_directory_from_friend_duplicity
${
1
}
${
2
}
#restore_directory_from_friend_obnam ${1} ${2}
}
function
backup_database_to_usb
{
...
...
@@ -493,38 +438,6 @@ function backup_directory_to_friend_duplicity {
remove_backups_temp_directory
}
function
backup_directory_to_friend_obnam
{
set_obnam_client_name
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam force-lock
-r
$SERVER_DIRECTORY
/backup/
${
2
}
--encrypt-with
${
ADMIN_BACKUP_KEY_ID
}
${
1
}
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam backup
-r
$SERVER_DIRECTORY
/backup/
${
2
}
--encrypt-with
${
ADMIN_BACKUP_KEY_ID
}
${
1
}
if
[[
$ENABLE_VERIFICATION
==
"yes"
]]
;
then
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam verify
-r
$SERVER_DIRECTORY
/backup/
${
2
}
--encrypt-with
${
ADMIN_BACKUP_KEY_ID
}
${
1
}
if
[
!
"
$?
"
=
"0"
]
;
then
if
[[
${
1
}
==
"/root/temp"
*
||
${
1
}
==
*
"tempbackup"
]]
;
then
shred
-zu
/root/temp
${
2
}
/
*
rm
-rf
/root/temp
${
2
}
fi
# Send a warning email
echo
"Unable to verify
${
2
}
"
| mail
-s
"
${
PROJECT_NAME
}
backup to friends"
${
ADMIN_EMAIL_ADDRESS
}
function_check restart_site
restart_site
exit
953
fi
fi
echo
"
$BACKUP_DUMMY_PASSWORD
"
| obnam forget
--keep
=
30d
-r
$SERVER_DIRECTORY
/backup/
${
2
}
--encrypt-with
${
ADMIN_BACKUP_KEY_ID
}
if
[
!
"
$?
"
=
"0"
]
;
then
if
[[
${
1
}
==
"/root/temp"
*
||
${
1
}
==
*
"tempbackup"
]]
;
then
shred
-zu
/root/temp
${
2
}
/
*
rm
-rf
/root/temp
${
2
}
fi
# Send a warning email
echo
"Unable to backup
${
2
}
"
| mail
-s
"
${
PROJECT_NAME
}
backup to friends"
${
ADMIN_EMAIL_ADDRESS
}
function_check restart_site
restart_site
exit
853
fi
}
function
backup_directory_to_friend
{
BACKUP_KEY_EXISTS
=
$(
gpg
--list-keys
"
$ADMIN_NAME
(backup key)"
)
if
[
!
"
$?
"
=
"0"
]
;
then
...
...
@@ -540,7 +453,6 @@ function backup_directory_to_friend {
fi
backup_directory_to_friend_duplicity
${
1
}
${
2
}
#backup_directory_to_friend_obnam ${1} ${2}
if
[[
${
1
}
==
"/root/temp"
*
||
${
1
}
==
*
"tempbackup"
]]
;
then
shred
-zu
/root/temp
${
2
}
/
*
...
...
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