forked from TrueCloudLab/rclone
vfs: update vfs/refresh rc command documentation
This commit is contained in:
parent
6349147af4
commit
2e80d4c18e
2 changed files with 11 additions and 8 deletions
|
@ -197,10 +197,14 @@ func (d *Dir) _readDir() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update d.items for each dir in the DirTree below this one and
|
||||||
|
// set the last read time - must be called with the lock held
|
||||||
func (d *Dir) _readDirFromDirTree(dirTree walk.DirTree, when time.Time) error {
|
func (d *Dir) _readDirFromDirTree(dirTree walk.DirTree, when time.Time) error {
|
||||||
return d._readDirFromEntries(dirTree[d.path], dirTree, when)
|
return d._readDirFromEntries(dirTree[d.path], dirTree, when)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update d.items and if dirTree is not nil update each dir in the DirTree below this one and
|
||||||
|
// set the last read time - must be called with the lock held
|
||||||
func (d *Dir) _readDirFromEntries(entries fs.DirEntries, dirTree walk.DirTree, when time.Time) error {
|
func (d *Dir) _readDirFromEntries(entries fs.DirEntries, dirTree walk.DirTree, when time.Time) error {
|
||||||
var err error
|
var err error
|
||||||
// Cache the items by name
|
// Cache the items by name
|
||||||
|
|
15
vfs/rc.go
15
vfs/rc.go
|
@ -1,6 +1,7 @@
|
||||||
package vfs
|
package vfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ncw/rclone/fs"
|
"github.com/ncw/rclone/fs"
|
||||||
|
@ -95,11 +96,8 @@ starting with dir will forget that dir, eg
|
||||||
if !ok {
|
if !ok {
|
||||||
return out, errors.Errorf("value must be string %q=%v", k, v)
|
return out, errors.Errorf("value must be string %q=%v", k, v)
|
||||||
}
|
}
|
||||||
switch strings.ToLower(s) {
|
recursive, err = strconv.ParseBool(s)
|
||||||
case "true", "1":
|
if err != nil {
|
||||||
recursive = true
|
|
||||||
case "false", "0":
|
|
||||||
default:
|
|
||||||
return out, errors.Errorf("invalid value %q=%v", k, v)
|
return out, errors.Errorf("invalid value %q=%v", k, v)
|
||||||
}
|
}
|
||||||
delete(in, k)
|
delete(in, k)
|
||||||
|
@ -151,9 +149,9 @@ starting with dir will forget that dir, eg
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
},
|
},
|
||||||
Title: "Refresh the directory cache tree.",
|
Title: "Refresh the directory cache.",
|
||||||
Help: `
|
Help: `
|
||||||
This reads the full directory tree for the paths and freshens the
|
This reads the directories for the specified paths and freshens the
|
||||||
directory cache.
|
directory cache.
|
||||||
|
|
||||||
If no paths are passed in then it will refresh the root directory.
|
If no paths are passed in then it will refresh the root directory.
|
||||||
|
@ -165,7 +163,8 @@ starting with dir will refresh that directory, eg
|
||||||
|
|
||||||
rclone rc vfs/refresh dir=home/junk dir2=data/misc
|
rclone rc vfs/refresh dir=home/junk dir2=data/misc
|
||||||
|
|
||||||
This refresh will use --fast-list if enabled.
|
If the parameter recursive=true is given the whole directory tree
|
||||||
|
will get refreshed. This refresh will use --fast-list if enabled.
|
||||||
|
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue