备份文件

This commit is contained in:
2022-05-21 11:35:01 +08:00
parent d4e7b563bc
commit b675aceb33
6 changed files with 129 additions and 7 deletions

47
define/ls.go Normal file
View File

@ -0,0 +1,47 @@
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2022-05-20 23:09
package define
// LsFileInfo ls查询出来的文件详细信息
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 23:10 2022/5/20
type LsFileInfo struct {
IsDir bool `json:"is_dir"` // 是否是目录
IsLink bool `json:"is_link"` // 是否链接文件
SourcePath string `json:"source_path"` // 是链接文件时, 链接的源文件路径
IsHidden bool `json:"is_hidden"` // 是否是隐藏文件
FullPath string `json:"full_path"` // 文件全路径
RelativePath string `json:"relative_path"` // 相对路径
Type string `json:"type"` // 文件类型, 如果为目录, 至为 - , 如果非 .xxx 结尾, 可执行为 bin , 不可执行为 unknown
Total int64 `json:"total"` // 文件总数
Permission *FullPermission `json:"permission"` // 文件权限
}
// FullPermission 文件权限
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 23:45 2022/5/20
type FullPermission struct {
User FilePermission `json:"user"`
Group FilePermission `json:"group"`
Other FilePermission `json:"other"`
}
// FilePermission 文件操作权限
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 23:31 2022/5/20
type FilePermission struct {
Read bool `json:"read"`
Write bool `json:"write"`
Exec bool `json:"exec"`
}

View File

@ -15,7 +15,7 @@ package define
type Result struct {
WorkDir string // 执行的目录
CmdPath string // 命令的路径
Err error // 异常信息
Error error // 异常信息
Output []byte // 输出的内容
StartTime int64 // 开始时间
FinishTime int64 // 完成时间