瀏覽代碼

Local backup for gogs

Bob Mottram 9 年之前
父節點
當前提交
2e52ff8b8a
沒有帳戶連結到提交者的電子郵件
共有 1 個檔案被更改,包括 18 行新增2 行删除
  1. 18
    2
      src/freedombone-app-gogs

+ 18
- 2
src/freedombone-app-gogs 查看文件

@@ -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 {