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
56fff9a6
Commit
56fff9a6
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Tidying
parent
b62ffd74
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-backup-remote
+18
-15
18 additions, 15 deletions
src/freedombone-backup-remote
with
18 additions
and
15 deletions
src/freedombone-backup-remote
+
18
−
15
View file @
56fff9a6
...
...
@@ -37,6 +37,7 @@ ENABLE_VERIFICATION="no"
export
TEXTDOMAIN
=
${
PROJECT_NAME
}
-backup-remote
export
TEXTDOMAINDIR
=
"/usr/share/locale"
# utilities needed for backup commands
UTILS_FILES
=
/usr/share/
${
PROJECT_NAME
}
/utils/
${
PROJECT_NAME
}
-utils-
*
for
f
in
$UTILS_FILES
do
...
...
@@ -102,19 +103,20 @@ function restart_site {
function
backup_configuration
{
echo
$"Backing up
${
PROJECT_NAME
}
configuration files"
if
[
!
-d
/root/tempbackupconfig
]
;
then
mkdir
-p
/root/tempbackupconfig
temp_backup_dir
=
/root/tempbackupconfig
if
[
!
-d
$temp_backup_dir
]
;
then
mkdir
-p
$temp_backup_dir
fi
cp
-f
$CONFIG_FILE
/root/
tempbackup
config
cp
-f
$COMPLETION_FILE
/root/
tempbackup
config
cp
-f
$CONFIG_FILE
$
temp
_
backup
_dir
cp
-f
$COMPLETION_FILE
$
temp
_
backup
_dir
if
[
-f
$BACKUP_EXTRA_DIRECTORIES
]
;
then
cp
-f
$BACKUP_EXTRA_DIRECTORIES
/root/
tempbackup
config
cp
-f
$BACKUP_EXTRA_DIRECTORIES
$
temp
_
backup
_dir
fi
# nginx password hashes
if
[
-f
/etc/nginx/.htpasswd
]
;
then
cp
-f
/etc/nginx/.htpasswd
/root/
tempbackup
config
/htpasswd
cp
-f
/etc/nginx/.htpasswd
$
temp
_
backup
_dir
/htpasswd
fi
backup_directory_to_friend
/root/
tempbackup
config
config
backup_directory_to_friend
$
temp
_
backup
_dir
config
}
function
backup_users
{
...
...
@@ -278,20 +280,21 @@ function backup_admin_readme {
function
backup_mariadb
{
if
[
${#
DATABASE_PASSWORD
}
-gt
1
]
;
then
if
[
!
-d
/root/tempmariadb
]
;
then
mkdir
/root/tempmariadb
temp_backup_dir
=
/root/tempmariadb
if
[
!
-d
$temp_backup_dir
]
;
then
mkdir
$temp_backup_dir
fi
mysqldump
--password
=
$DATABASE_PASSWORD
mysql user
>
/root/tempmariadb
/mysql.sql
if
[
!
-s
/root/tempmariadb
/mysql.sql
]
;
then
mysqldump
--password
=
$DATABASE_PASSWORD
mysql user
>
$temp_backup_dir
/mysql.sql
if
[
!
-s
$temp_backup_dir
/mysql.sql
]
;
then
echo
$"Unable to backup MariaDB settings"
rm
-rf
/root/tempmariadb
rm
-rf
$temp_backup_dir
# Send a warning email
echo
$"Unable to export database settings"
| mail
-s
"
${
PROJECT_NAME
}
backup to friends"
$ADMIN_EMAIL_ADDRESS
exit
653
fi
echo
"
$DATABASE_PASSWORD
"
>
/root/tempmariadb
/db
chmod
400
/root/tempmariadb
/db
backup_directory_to_friend
/root/tempmariadb
mariadb
echo
"
$DATABASE_PASSWORD
"
>
$temp_backup_dir
/db
chmod
400
$temp_backup_dir
/db
backup_directory_to_friend
$temp_backup_dir
mariadb
fi
}
...
...
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