代码拉取完成,页面将自动刷新
同步操作将从 沧海cos泪/FileCleaner 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package main
import (
"FileCleaner/control"
"FileCleaner/read"
"FileCleaner/record"
"FileCleaner/version"
"FileCleaner/write"
"flag"
"fmt"
"os"
"time"
)
var (
ver bool
basePath string
delMethod string
casCade bool
parallel int
day string
ctime bool
mtime bool
atime bool
)
// 初始化输入参数
func init() {
flag.BoolVar(&ver, "v", false, "show version and exit")
flag.StringVar(&basePath, "p", "/home/fastdfs/storage/data", "Plz enter an absolute path")
flag.BoolVar(&casCade, "c", false, "Cascade control the dir (default false)")
flag.IntVar(¶llel, "n", 4, "The number of parallel control")
flag.StringVar(&delMethod, "dm", "ln", "Plz Usage 'rm','ln' or 'dry'; rm: remove the file, ln: remove and link the file, dry: dryRun mode")
flag.StringVar(&day, "t", "", "Enter the day, like -1,0,+1")
flag.BoolVar(&ctime, "ctime", false, "Enable clean file by the created time (default false) ")
flag.BoolVar(&mtime, "mtime", false, "Enable clean file by the modified time (default false)")
flag.BoolVar(&atime, "atime", false, "Enable clean file by the accessed time (default false)")
//flag.Usage = usage()
flag.Parse()
if ver {
fmt.Printf("FileCleaner Version: %s\n", version.Version)
os.Exit(0)
}
}
func main() {
startTime := time.Now()
// 启用goroutine parallel限制
control.CtlParallel(parallel)
// goroutine 后台记录操作信息 并输出结果
go record.Record()
// 读文件时间控制器
read.ReadByTime(ctime, mtime, atime, day)
// 读文件
read.Read(basePath, casCade)
// 写文件
write.Write(delMethod)
// 输出统计结果信息
record.Report(startTime)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。