Commit bb18ec92 authored by Boxiang Sun's avatar Boxiang Sun

peertube backup fixup

parent e6c66971
Pipeline #24946 passed with stage
in 0 seconds
......@@ -18,7 +18,7 @@ md5sum = 9eed4136d9d6f8f855b73bbfefa6397c
[instance-peertube]
_update_hash_filename_ = instance-peertube.cfg.in
md5sum = f789217b73552cc58f5db4fd2fd77203
md5sum = 98bb0b9767129b2fb67dba2ed02e4d04
[template-nginx-service]
filename = template-nginx-service.sh.in
......@@ -50,4 +50,4 @@ md5sum = f1f82101258de19068262b7213fc478b
[template-peertube-backup-script]
filename = template-peertube-backup.sh.in
md5sum = 5dd471d958e68ce4e14cccc090ef23ce
md5sum = 58d1a4fe246169dea94d7d243b4bac9e
......@@ -4,6 +4,12 @@
"description": "Parameters to instantiate Peertube",
"additionalProperties": false,
"properties": {
"frequency": {
"title": "Backup Frequency",
"description": "Backup Frequency",
"default": "",
"type": "string"
},
"fronted-url": {
"title": "Frontend URL",
"description": "Frontend URL",
......
......@@ -193,13 +193,14 @@ logfile = ${directory:log}/crond.log
recipe = slapos.recipe.template
url = {{ tempalte_peertube_backup }}
output = ${directory:etc}/${:_buildout_section_name_}
mode = 0744
[peertube-backup-cron]
recipe = slapos.recipe.template
url = {{ template_crontab_line }}
output = ${directory:cron-lines}/${:_buildout_section_name_}
script = ${peertube-backup-script:output}
frequency = {{ slapparameter_dict.get('frequency', 'daily') }}
frequency = {{ slapparameter_dict.get('frequency', '@daily') }}
[activate-crontab-file]
# XXX File is never removed
......
echo "Hello Peertube"
#!${dash-output:dash}
# Dump the databse
$${postgresql:bin}/pg_dump -h $${postgresql:pgdata-directory} -U $${postgresql:superuser} -Fc peertube_prod > $${directory:peertube_directory}/peertube_prod-dump.db
# For test the database contains expected content
$${postgresql:bin}/pg_dump -h $${postgresql:pgdata-directory} -U $${postgresql:superuser} --column-inserts --data-only --table=user peertube_prod > $${directory:peertube_directory}/peertube_prod-dump.sql
cp -r $${directory:srv}/postgresql $${directory:peertube_directory}/postgresql_back
$${postgresql:bin}/pg_dump -h $${postgresql:pgdata-directory} -U $${postgresql:superuser} -Fc peertube_prod > $${directory:srv}/backup/peertube_prod-dump.db
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment