restic/cmd/khepri/cmd_snapshots.go

37 lines
729 B
Go
Raw Normal View History

2014-08-04 22:55:54 +02:00
package main
import (
"errors"
"fmt"
"github.com/fd0/khepri"
2014-09-23 22:39:12 +02:00
"github.com/fd0/khepri/backend"
2014-08-04 22:55:54 +02:00
)
const TimeFormat = "02.01.2006 15:04:05 -0700"
2014-09-23 22:39:12 +02:00
func commandSnapshots(be backend.Server, key *khepri.Key, args []string) error {
2014-08-04 22:55:54 +02:00
if len(args) != 0 {
return errors.New("usage: snapshots")
}
2014-09-23 22:39:12 +02: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 22:55:54 +02:00
return nil
}