2017-04-25 21:27:29 +00:00
|
|
|
package folders
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.jcg.re/jcgruenhage/borgocli/generate/authorized_keys"
|
2017-05-30 22:03:10 +00:00
|
|
|
"gopkg.in/yaml.v2"
|
2017-04-25 21:27:29 +00:00
|
|
|
"os"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Run(data []byte) {
|
|
|
|
var hosts authorized_keys.HostList
|
2017-05-30 22:03:10 +00:00
|
|
|
err := yaml.Unmarshal(data, &hosts)
|
2017-04-25 21:27:29 +00:00
|
|
|
check(err)
|
|
|
|
fmt.Println("Backup Paths:")
|
|
|
|
for i := 0; i < len(hosts.Hosts); i++ {
|
|
|
|
os.MkdirAll(hosts.TotalPath(i), os.ModePerm)
|
|
|
|
fmt.Print(" " + hosts.TotalPath(i))
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
func check(e error) {
|
|
|
|
if e != nil {
|
|
|
|
panic(e)
|
|
|
|
}
|
|
|
|
}
|