Files
kopia/cli/fscache.go
Jarek Kowalski ad4b222939 cli: added support for copying (or moving) snapshot history (#703)
Both source and destination can be specified using user@host,
@host or user@host:/path where destination values override the
corresponding parts of the source, so both targeted
and mass copying is supported.

Supported combinations are:

Source:             Destination         Behavior
---------------------------------------------------
@host1              @host2              copy snapshots from all users of host1
user1@host1         @host2              copy all snapshots to user1@host2
user1@host1         user2@host2         copy all snapshots to user2@host2
user1@host1:/path1  @host2              copy to user1@host2:/path1
user1@host1:/path1  user2@host2         copy to user2@host2:/path1
user1@host1:/path1  user2@host2:/path2  copy snapshots from single path

When --move is specified, the matching source snapshots are also deleted.

* cli: upgraded kingpin to latest version (not tagged)

This allows using `EnableFileExpansion` to disable treating
arguments prefixed with "@" as file includes.
2020-12-04 16:34:55 -08:00

25 lines
630 B
Go

package cli
import (
"github.com/alecthomas/kingpin"
"github.com/kopia/kopia/fs/cachefs"
)
var (
maxCachedEntries int
maxCachedDirectories int
)
func setupFSCacheFlags(cmd *kingpin.CmdClause) {
cmd.Flag("max-cached-entries", "Limit the number of cached directory entries").Default("100000").IntVar(&maxCachedEntries)
cmd.Flag("max-cached-dirs", "Limit the number of cached directories").Default("100").IntVar(&maxCachedDirectories)
}
func newFSCache() cachefs.DirectoryCacher {
return cachefs.NewCache(&cachefs.Options{
MaxCachedDirectories: maxCachedDirectories,
MaxCachedEntries: maxCachedEntries,
})
}