Browse Source

Local backup for gogs

Bob Mottram 9 years ago
parent
commit
2e52ff8b8a
No account linked to committer's email
1 changed files with 18 additions and 2 deletions
  1. 18
    2
      src/freedombone-app-gogs

+ 18
- 2
src/freedombone-app-gogs View File

@@ -50,11 +50,27 @@ function upgrade_gogs {
50 50
 }
51 51
 
52 52
 function backup_local_gogs {
53
-	echo ''
53
+	GIT_DOMAIN_NAME='gogs'
54
+	if grep -q "Gogs domain" $COMPLETION_FILE; then
55
+		GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}')
56
+	fi
57
+
58
+	echo $"Backing up gogs"
59
+
60
+	function_check backup_database_local
61
+	backup_database_local gogs
62
+
63
+	function_check backup_directory_to_usb
64
+	backup_directory_to_usb /root/tempgogsdata gogsdata
65
+	backup_directory_to_usb $GOPATH/src/github.com/gogits/gogs/custom gogs
66
+	backup_directory_to_usb /home/git/gogs-repositories gogsrepos
67
+	backup_directory_to_usb /home/git/.ssh gogsssh
68
+
69
+	echo $"Gogs backup complete"
54 70
 }
55 71
 
56 72
 function backup_remote_gogs {
57
-	echo ''
73
+	echo -n ''
58 74
 }
59 75
 
60 76
 function remove_gogs {