|
@@ -50,20 +50,6 @@ func main() {
|
|
|
switch {
|
|
|
case frompath != "" && topath != "":
|
|
|
fmt.Println("sync from", frompath, "to", topath)
|
|
|
- // err := filepath.Walk(frompath, func(path string, info fs.FileInfo, err error) error {
|
|
|
- // fmt.Println(path)
|
|
|
- // if err != nil {
|
|
|
- // fmt.Println(err)
|
|
|
- // }
|
|
|
- // if info != nil {
|
|
|
- // fmt.Println(path, info.Size(), info.ModTime())
|
|
|
- // }
|
|
|
- // return nil
|
|
|
- // })
|
|
|
- // if err != nil {
|
|
|
- // println(err.Error())
|
|
|
- // os.Exit(1)
|
|
|
- // }
|
|
|
for {
|
|
|
err := sync(frompath, topath)
|
|
|
if err != nil {
|
|
@@ -85,6 +71,9 @@ func sync(frompath, topath string) (err error) {
|
|
|
}
|
|
|
count := 0
|
|
|
e = fw.List(func(basedir, fpath string) bool {
|
|
|
+ if option.Debug {
|
|
|
+ fmt.Println("basedir=", basedir, ", fpath=", fpath)
|
|
|
+ }
|
|
|
absbasedir, e := filepath.Abs(basedir)
|
|
|
if e != nil {
|
|
|
err = e
|