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
388a4c88
Commit
388a4c88
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Backup the database and content subdirectory for ghost
parent
14efdb6a
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-app-ghost
+23
-5
23 additions, 5 deletions
src/freedombone-app-ghost
with
23 additions
and
5 deletions
src/freedombone-app-ghost
+
23
−
5
View file @
388a4c88
...
...
@@ -221,12 +221,12 @@ function backup_local_ghost {
GHOST_DOMAIN_NAME
=
$(
get_completion_param
"ghost domain"
)
fi
ghost_path
=
/var/www/
${
GHOST_DOMAIN_NAME
}
/htdocs
ghost_path
=
/var/www/
${
GHOST_DOMAIN_NAME
}
/htdocs
/content
if
[
-d
$ghost_path
]
;
then
function_check backup_database_to_usb
backup_database_to_usb ghost
backup_directory_to_usb
$ghost_path
ghost
backup_directory_to_usb
$ghost_path
ghost
content
restart_site
fi
}
...
...
@@ -245,6 +245,15 @@ function restore_local_ghost {
function_check restore_database
restore_database ghost
${
GHOST_DOMAIN_NAME
}
temp_restore_dir
=
/root/tempghostcontent
function_check restore_directory_from_usb
restore_directory_from_usb
$temp_restore_dir
ghostcontent
if
[
-d
$temp_restore_dir
]
;
then
cp
-r
$temp_restore_dir
/var/www/
$GHOST_DOMAIN_NAME
/htdocs/content/
*
/var/www/
$GHOST_DOMAIN_NAME
/htdocs/content/
chown
-R
ghost:ghost /var/www/
$GHOST_DOMAIN_NAME
/htdocs/content
rm
-rf
$temp_restore_dir
fi
MARIADB_PASSWORD
=
$(
${
PROJECT_NAME
}
-pass
-u
root
-a
mariadb
)
ghost_config
=
/var/www/
${
GHOST_DOMAIN_NAME
}
/htdocs/config.js
sed
-i
"s|password :.*|password : '
${
MARIADB_PASSWORD
}
',|g"
$ghost_config
...
...
@@ -278,11 +287,11 @@ function backup_remote_ghost {
GHOST_DOMAIN_NAME
=
$(
get_completion_param
"ghost domain"
)
fi
temp_backup_dir
=
/var/www/
${
GHOST_DOMAIN_NAME
}
/htdocs
temp_backup_dir
=
/var/www/
${
GHOST_DOMAIN_NAME
}
/htdocs
/content
if
[
-d
$temp_backup_dir
]
;
then
suspend_site
${
GHOST_DOMAIN_NAME
}
backup_database_to_friend ghost
backup_directory_to_friend
$temp_backup_dir
ghost
backup_directory_to_friend
$temp_backup_dir
ghost
content
restart_site
else
echo
$"Ghost domain specified but not found in /var/www/
${
GHOST_DOMAIN_NAME
}
"
...
...
@@ -306,7 +315,16 @@ function restore_remote_ghost {
function_check ghost_create_database
ghost_create_database
restore_database_from_friend ghost
${
GHOST_DOMAIN_NAME
}
restore_database_from_friend ghost
temp_restore_dir
=
/root/tempghostcontent
function_check restore_directory_from_friend
restore_directory_from_friend
$temp_restore_dir
ghostcontent
if
[
-d
$temp_restore_dir
]
;
then
cp
-r
$temp_restore_dir
/var/www/
$GHOST_DOMAIN_NAME
/htdocs/content/
*
/var/www/
$GHOST_DOMAIN_NAME
/htdocs/content/
chown
-R
ghost:ghost /var/www/
$GHOST_DOMAIN_NAME
/htdocs/content
rm
-rf
$temp_restore_dir
fi
MARIADB_PASSWORD
=
$(
${
PROJECT_NAME
}
-pass
-u
root
-a
mariadb
)
ghost_config
=
/var/www/
${
GHOST_DOMAIN_NAME
}
/htdocs/config.js
...
...
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