Last active
April 16, 2019 12:49
-
-
Save stefanopulze/d0271b848a046ef74cf958ced9ef0038 to your computer and use it in GitHub Desktop.
Gitlab backup to ownCloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| cd /var/opt/gitlab/backups/ | |
| gitlab-rake gitlab:backup:create | |
| filename="$(ls -t /var/opt/gitlab/backups/ | head -1)" | |
| date=$(date -I) | |
| basicAuth="username:password" | |
| remotedir="https://owncloud_remote_url/remote.php/webdav/backups" # make sure folder exists | |
| # Add sensitive information, needed for complete restore | |
| tar -uvf $filename /etc/gitlab/ | |
| curl -v -T $filename -u "$basicAuth" "${remotedir}/${date}-${filename}" | |
| rm $filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment