Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AD-Control-Golang
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶腾飞
AD-Control-Golang
Commits
f6c7d58c
Commit
f6c7d58c
authored
Aug 11, 2020
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v1.6.1 优化备份方案
parent
96fa9d14
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
8 deletions
+15
-8
public/env.go
+2
-4
public/msg_deal.go
+8
-2
public/public.go
+1
-1
public/win.go
+3
-0
users/menu.go
+1
-1
No files found.
public/env.go
View file @
f6c7d58c
...
@@ -8,7 +8,7 @@ const DaemonListen string = ":" + DaemonPort
...
@@ -8,7 +8,7 @@ const DaemonListen string = ":" + DaemonPort
const
ADServerDaemon
string
=
Host_adserver
+
DaemonListen
const
ADServerDaemon
string
=
Host_adserver
+
DaemonListen
const
WxwrokDaemon
string
=
":16823"
const
WxwrokDaemon
string
=
":16823"
const
RandMax
int
=
60
const
RandMax
int
=
60
const
Version
string
=
"1.6.
0
"
const
Version
string
=
"1.6.
1
"
// user //
// user //
...
@@ -45,8 +45,6 @@ var Dir_tmp string = GetEnv("tmp")
...
@@ -45,8 +45,6 @@ var Dir_tmp string = GetEnv("tmp")
var
Dir_Windows
string
=
GetEnv
(
"windir"
)
+
`\`
var
Dir_Windows
string
=
GetEnv
(
"windir"
)
+
`\`
const
Dir_DocuBase
string
=
`C:\Users\Public\Documents\AD-Control\`
const
Dir_DocuBase
string
=
`C:\Users\Public\Documents\AD-Control\`
const
Dir_ADsoftware_local
string
=
`H:\software\softlike\`
const
Dir_ADsoftware_local
string
=
`H:\software\softlike\`
const
Dir_dept_share
string
=
"办公室部门内部共享"
var
Dir_dept_share_full
string
=
Reg_Value_WeDriveDir
+
`\`
+
Dir_dept_share
const
Dir_DCSave
string
=
`D:\DomainUserBackupV2`
const
Dir_DCSave
string
=
`D:\DomainUserBackupV2`
var
Dir_WeDrive
=
[
2
]
string
{
Dir_appdata
+
`\Tencent\WXWork\Data`
,
Dir_userprofile
+
`\Documents\WXWork`
}
var
Dir_WeDrive
=
[
2
]
string
{
Dir_appdata
+
`\Tencent\WXWork\Data`
,
Dir_userprofile
+
`\Documents\WXWork`
}
var
Dir_Be
=
[]
string
{
Dir_DocuBase
}
var
Dir_Be
=
[]
string
{
Dir_DocuBase
}
...
@@ -72,7 +70,7 @@ const App_Sync_dir string = `C:\Progra~1\zhiwei\AllWay_Sync\Bin\syncappw.exe
...
@@ -72,7 +70,7 @@ const App_Sync_dir string = `C:\Progra~1\zhiwei\AllWay_Sync\Bin\syncappw.exe
// backup //
// backup //
var
Bak_Version
string
=
"081
0
"
var
Bak_Version
string
=
"081
1
"
// reg info //
// reg info //
...
...
public/msg_deal.go
View file @
f6c7d58c
...
@@ -219,17 +219,22 @@ func (bak * MJbackup)Msg_Deal() interface{}{
...
@@ -219,17 +219,22 @@ func (bak * MJbackup)Msg_Deal() interface{}{
bak
.
Computername
=
User_computername
bak
.
Computername
=
User_computername
bak
.
Explain
=
"Backup Init"
bak
.
Explain
=
"Backup Init"
bak
.
Instruction
=
Msg_Backup_Status_Continue
bak
.
Instruction
=
Msg_Backup_Status_Continue
PntInfo
(
bak
.
Explain
)
// 如果版本不是最新
// 如果版本不是最新
currentVersion
:=
Reg_Query_DC
(
Reg_Name_BackupVersion
)
currentVersion
:=
Reg_Query_DC
(
Reg_Name_BackupVersion
)
if
(
bak
.
Version
!=
currentVersion
)
||
if
(
bak
.
Version
!=
currentVersion
)
||
NotExist
(
File_Sync_profile
){
NotExist
(
Dir_Sync_Config
+
File_Sync_profile
){
MkdirAll
(
Dir_Sync_Config
)
// 1 复制 最新文件
// 1 复制 最新文件
if
_
,
err
:=
CopyFile
(
File_Sync_profile_full
,
SMB_ADSoftPlusSync
+
File_Sync_profile
);
err
!=
nil
{
if
_
,
err
:=
CopyFile
(
File_Sync_profile_full
,
SMB_ADSoftPlusSync
+
File_Sync_profile
);
err
!=
nil
{
return
GJerror
(
err
)
return
GJerror
(
err
)
}
}
if
_
,
err
:=
CopyFile
(
File_Sync_settings_full
,
SMB_ADSoftPlusSync
+
File_Sync_settings
);
err
!=
nil
{
return
GJerror
(
err
)
}
...
@@ -237,9 +242,10 @@ func (bak * MJbackup)Msg_Deal() interface{}{
...
@@ -237,9 +242,10 @@ func (bak * MJbackup)Msg_Deal() interface{}{
Reg_Write_DC
(
Reg_Name_BackupVersion
,
bak
.
Version
)
Reg_Write_DC
(
Reg_Name_BackupVersion
,
bak
.
Version
)
bak
.
Explain
=
"Backup update config"
bak
.
Explain
=
"Backup update config"
PntInfo
(
bak
.
Explain
)
}
}
PntInfo
(
bak
.
Explain
)
SendServer
(
bak
)
SendServer
(
bak
)
return
nil
return
nil
...
...
public/public.go
View file @
f6c7d58c
...
@@ -13,10 +13,10 @@ import (
...
@@ -13,10 +13,10 @@ import (
// 获取 消息类型
// 获取 消息类型
func
GetMsgType
(
b
[]
byte
)
string
{
func
GetMsgType
(
b
[]
byte
)
string
{
//{"msgtype":"report","...":"..."}
//{"msgtype":"report","...":"..."}
// 提取第一个冒号后的第二位和第一个逗号的前一位
// 提取第一个冒号后的第二位和第一个逗号的前一位
// 也就是msgtype的内容
// 也就是msgtype的内容
PrintLog
(
string
(
b
))
return
string
(
b
[
bytes
.
IndexByte
(
b
,
':'
)
+
2
:
bytes
.
IndexByte
(
b
,
','
)
-
1
])
return
string
(
b
[
bytes
.
IndexByte
(
b
,
':'
)
+
2
:
bytes
.
IndexByte
(
b
,
','
)
-
1
])
}
}
...
...
public/win.go
View file @
f6c7d58c
...
@@ -425,6 +425,9 @@ func RemoveFile(name string)error{
...
@@ -425,6 +425,9 @@ func RemoveFile(name string)error{
func
Mkdir
(
dir
string
){
func
Mkdir
(
dir
string
){
os
.
Mkdir
(
dir
,
os
.
ModeSetuid
)
os
.
Mkdir
(
dir
,
os
.
ModeSetuid
)
}
}
func
MkdirAll
(
dir
string
)
error
{
return
os
.
MkdirAll
(
dir
,
os
.
ModeSetuid
)
}
func
ExistFolder
(
dir
string
){
func
ExistFolder
(
dir
string
){
if
NotExist
(
dir
)
{
Mkdir
(
dir
)
}
if
NotExist
(
dir
)
{
Mkdir
(
dir
)
}
}
}
...
...
users/menu.go
View file @
f6c7d58c
...
@@ -271,7 +271,7 @@ func batchOpenWeb(inTE,outTE *walk.TextEdit,batch int){
...
@@ -271,7 +271,7 @@ func batchOpenWeb(inTE,outTE *walk.TextEdit,batch int){
// 其他工具 备份用户文件
// 其他工具 备份用户文件
func
tBakcupUser
(){
func
tBakcupUser
(){
if
pub
.
Msg_YesNo
(
"是否执行一次手动备份用户文件夹。目标文件夹:"
+
pub
.
Dir_userprofile
)
==
1
{
if
pub
.
Msg_YesNo
(
"是否执行一次手动备份用户文件夹。目标文件夹:"
+
pub
.
Dir_userprofile
)
==
1
{
pub
.
SendServerReport
(
pub
.
Msg_Report_
Star
tBak
)
pub
.
SendServerReport
(
pub
.
Msg_Report_
Ini
tBak
)
}
}
}
}
// 其他工具 更新手机代理程序
// 其他工具 更新手机代理程序
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment