mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 09:01:33 +02:00
cmd and fs: Added new command settier which performs storage tier changes on
supported remotes
This commit is contained in:
committed by
Nick Craig-Wood
parent
9594fd0a0c
commit
7accd30da8
@ -1407,6 +1407,21 @@ func CopyFile(fdst fs.Fs, fsrc fs.Fs, dstFileName string, srcFileName string) (e
|
||||
return moveOrCopyFile(fdst, fsrc, dstFileName, srcFileName, true)
|
||||
}
|
||||
|
||||
// SetTier changes tier of object in remote
|
||||
func SetTier(fsrc fs.Fs, tier string) error {
|
||||
return ListFn(fsrc, func(o fs.Object) {
|
||||
objImpl, ok := o.(fs.SetTierer)
|
||||
if !ok {
|
||||
fs.Errorf(fsrc, "Remote object does not implement SetTier")
|
||||
return
|
||||
}
|
||||
err := objImpl.SetTier(tier)
|
||||
if err != nil {
|
||||
fs.Errorf(fsrc, "Failed to do SetTier, %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// ListFormat defines files information print format
|
||||
type ListFormat struct {
|
||||
separator string
|
||||
|
Reference in New Issue
Block a user