Skip to content

Commit

Permalink
fix backup (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-otten authored Dec 20, 2024
1 parent 1b573fd commit f4811af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bookstack-helm/templates/backup_script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data:
backup_name="wiki_backup_db_$(date +%s).tar.gz"
tar -chzvf $backup_name wiki.sql
echo "push to s3"
apk update
apk add aws-cli
aws s3 cp ./$backup_name "$BACKUP_S3_URL"
echo "uploaded"
Expand All @@ -31,12 +32,13 @@ data:
echo "done"
backup.entrypoint.sh: |
echo "Startup"
apk update
apk add aws-cli
mkdir -p /app/www/storage/uploads/
ln -s /config/www/files /app/www/storage/uploads/files
ln -s /config/www/images /app/www/storage/uploads/images
ln -s /config/www/uploads /app/www/public/uploads
echo "#/bin/sh" > /etc/periodic/daily/backup
echo "#!/bin/sh" > /etc/periodic/daily/backup
echo "sh /backup.files.sh" >> /etc/periodic/daily/backup
chmod +x /etc/periodic/daily/backup
echo "Starting crond"
Expand All @@ -47,6 +49,7 @@ data:
echo "Restore file is: $RESTORE_S3_URL"
if [ ! -z "$RESTORE_S3_URL" ]; then
echo "Restoring from $RESTORE_S3_URL"
apk update
apk add aws-cli
aws s3 cp "$RESTORE_S3_URL" /tmp/restore.tgz
echo "downloaded tarball"
Expand All @@ -61,6 +64,7 @@ data:
echo "Restore file is: $RESTORE_S3_URL"
if [ ! -z "$RESTORE_S3_URL" ]; then
echo "Restoring from $RESTORE_S3_URL"
apk update
apk add aws-cli
aws s3 cp "$RESTORE_S3_URL" /tmp/restore.tgz
echo "downloaded tarball"
Expand Down

0 comments on commit f4811af

Please sign in to comment.