浏览代码

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
 }
50
 }
51
 
51
 
52
 function backup_local_gogs {
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
 function backup_remote_gogs {
72
 function backup_remote_gogs {
57
-	echo ''
73
+	echo -n ''
58
 }
74
 }
59
 
75
 
60
 function remove_gogs {
76
 function remove_gogs {