First steps -pref-dir

This commit is contained in:
Etienne Charlier
2017-06-05 23:16:11 +02:00
parent 36044e13c0
commit c88e148d59
10 changed files with 194 additions and 31 deletions

View File

@@ -1510,8 +1510,9 @@ func (manager *SnapshotManager) PruneSnapshots(top string, selfID string, snapsh
if len(revisionsToBeDeleted) > 0 && (len(tags) > 0 || len(retentions) > 0) {
LOG_WARN("DELETE_OPTIONS", "Tags or retention policy will be ignored if at least one revision is specified")
}
logDir := path.Join(top, DUPLICACY_DIRECTORY, "logs")
duplicacyDirectory := GetDotDuplicacyPathName(top)
logDir := path.Join(duplicacyDirectory, "logs")
os.Mkdir(logDir, 0700)
logFileName := path.Join(logDir, time.Now().Format("prune-log-20060102-150405"))
logFile, err := os.OpenFile(logFileName, os.O_WRONLY | os.O_CREATE | os.O_TRUNC, 0600)