restic/cmd/khepri/cmd_snapshots.go

37 lines
729 B
Go
Raw Normal View History

2014-08-04 20:55:54 +00:00
package main
import (
"errors"
"fmt"
"github.com/fd0/khepri"
2014-09-23 20:39:12 +00:00
"github.com/fd0/khepri/backend"
2014-08-04 20:55:54 +00:00
)
const TimeFormat = "02.01.2006 15:04:05 -0700"
2014-09-23 20:39:12 +00:00
func commandSnapshots(be backend.Server, key *khepri.Key, args []string) error {
2014-08-04 20:55:54 +00:00
if len(args) != 0 {
return errors.New("usage: snapshots")
}
2014-09-23 20:39:12 +00:00
// ch, err := khepri.NewContentHandler(be, key)
// if err != nil {
// return err
// }
backend.EachID(be, backend.Snapshot, func(id backend.ID) {
// sn, err := ch.LoadSnapshot(id)
// if err != nil {
// fmt.Fprintf(os.Stderr, "error loading snapshot %s: %v\n", id, err)
// return
// }
// fmt.Printf("snapshot %s\n %s at %s by %s\n",
// id, sn.Dir, sn.Time, sn.Username)
fmt.Println(id)
})
2014-08-04 20:55:54 +00:00
return nil
}