initial commit
This commit is contained in:
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
9
.idea/gitea-backup.iml
generated
Normal file
9
.idea/gitea-backup.iml
generated
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/gitea-backup.iml" filepath="$PROJECT_DIR$/.idea/gitea-backup.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
30
gitea-backup.sh
Normal file
30
gitea-backup.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Gitea backup script
|
||||
# This script will backup the gitea database and the gitea repository directory
|
||||
|
||||
# Set the backup directory
|
||||
BACKUP_DIR="/home/ubuntu/dump"
|
||||
APP_INI="/var/snap/gitea/common/conf/app.ini"
|
||||
S3_ENDPOINT_URL="https://s3.us-west-1.wasabisys.com"
|
||||
|
||||
cd $BACKUP_DIR || exit
|
||||
|
||||
/usr/bin/ssh masonpayne@192.168.1.90 "say 'Starting Git-tea backup'"
|
||||
|
||||
# Remove previous backups
|
||||
# rm -rf $BACKUP_DIR/*
|
||||
rm -rf /home/ubuntu/dump/*
|
||||
|
||||
/snap/gitea/current/gitea dump -c $APP_INI -w $BACKUP_DIR --type tar
|
||||
|
||||
# remove left over data folder
|
||||
rm -rf /home/ubuntu/dump/data
|
||||
|
||||
# send backup file to local server
|
||||
/usr/bin/scp -r $BACKUP_DIR/ masonpayne@192.168.1.90:gitea-backup/
|
||||
/usr/bin/ssh masonpayne@192.168.1.90 "say 'Git-tea local backup complete'"
|
||||
|
||||
# send backup file to s3
|
||||
/usr/local/bin/aws s3 cp $BACKUP_DIR/ s3://gitea-backup/ --recursive --endpoint-url=$S3_ENDPOINT_URL
|
||||
/usr/bin/ssh masonpayne@192.168.1.90 "say 'Git-tea cloud backup complete'"
|
Reference in New Issue
Block a user