Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
22 righe
444 B
22 righe
444 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"git.binarythought.com/cdramey/qurl/storage"
|
|
"os"
|
|
"path"
|
|
"time"
|
|
)
|
|
|
|
func manageBackup(stor storage.Storage, dir string, interval int) {
|
|
for {
|
|
time.Sleep(time.Duration(interval) * time.Second)
|
|
fname := fmt.Sprintf("qurl-%s.backup",
|
|
time.Now().Format("20060102150405"))
|
|
|
|
err := stor.Backup(path.Join(dir, fname))
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Backup failure: %s\n", err.Error())
|
|
}
|
|
}
|
|
}
|