Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redmine_ynh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
coops
redmine_ynh
Commits
fd128e3a
Unverified
Commit
fd128e3a
authored
Mar 22, 2019
by
liberodark
Committed by
GitHub
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update backup
parent
602f2e9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
27 deletions
+54
-27
backup
scripts/backup
+54
-27
No files found.
scripts/backup
View file @
fd128e3a
#!/bin/bash
#!/bin/bash
# Exit on command errors and treat unset variables as an error
#=================================================
set
-eu
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source
_common.sh
source
/usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup
()
{
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
# See comments in install script
app
=
$YNH_APP_INSTANCE_NAME
app
=
$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
final_path
=
$(
ynh_app_setting_get
$app
final_path
)
source
/usr/share/yunohost/helpers
domain
=
$(
ynh_app_setting_get
$app
domain
)
db_name
=
$(
ynh_app_setting_get
$app
psql_db
)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup
"
$final_path
"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup
"/etc/nginx/conf.d/
$domain
.d/
$app
.conf"
#=================================================
# BACKUP THE PSQL DATABASE
#=================================================
ynh_psql_dump_db
"
$db_name
"
>
db.sql
ynh_backup
"db.sql"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP THE CRON FILE
#=================================================
# Backup sources & data
ynh_backup
"/etc/cron.d/
$app
"
# Note: the last argument is where to save this path, see the restore script.
ynh_backup
"/var/www/
${
app
}
"
"sources"
### MySQL (remove if not used) ###
# If a MySQL database is used:
# # Dump the database
# dbname=$app
# dbuser=$app
# dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
# mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./dump.sql
### MySQL end ###
# Copy NGINX configuration
domain
=
$(
ynh_app_setting_get
"
$app
"
domain
)
ynh_backup
"/etc/nginx/conf.d/
${
domain
}
.d/
${
app
}
.conf"
"nginx.conf"
### PHP (remove if not used) ###
# If a dedicated php-fpm process is used:
# # Copy PHP-FPM pool configuration
# ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
### PHP end ###
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment