mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
tweaks to backup & verifydata tool to make a typical backup+verifydata produce no output
for easy use in a crontab
This commit is contained in:
parent
d25131f2f2
commit
cafbfc5fdf
4 changed files with 10 additions and 13 deletions
|
@ -509,9 +509,6 @@ func backupctl(ctx context.Context, ctl *ctl) {
|
|||
}
|
||||
p := srcpath[len(srcDataDir)+1:]
|
||||
if p == "queue" || p == "acme" || p == "tmp" {
|
||||
if p == "tmp" {
|
||||
xwarnx("skipping entire tmp directory", nil, mlog.Field("path", p))
|
||||
}
|
||||
return fs.SkipDir
|
||||
}
|
||||
l := strings.Split(p, string(filepath.Separator))
|
||||
|
|
4
doc.go
4
doc.go
|
@ -352,8 +352,8 @@ specifically mounts the data directory, causing attempts to hardlink outside it
|
|||
to fail with an error about cross-device linking.
|
||||
|
||||
All files in the data directory that aren't recognized (i.e. other than known
|
||||
database files, message files, an acme directory, etc), are stored, but with a
|
||||
warning.
|
||||
database files, message files, an acme directory, the "tmp" directory, etc),
|
||||
are stored, but with a warning.
|
||||
|
||||
A clean successful backup does not print any output by default. Use the
|
||||
-verbose flag for details, including timing.
|
||||
|
|
4
main.go
4
main.go
|
@ -983,8 +983,8 @@ specifically mounts the data directory, causing attempts to hardlink outside it
|
|||
to fail with an error about cross-device linking.
|
||||
|
||||
All files in the data directory that aren't recognized (i.e. other than known
|
||||
database files, message files, an acme directory, etc), are stored, but with a
|
||||
warning.
|
||||
database files, message files, an acme directory, the "tmp" directory, etc),
|
||||
are stored, but with a warning.
|
||||
|
||||
A clean successful backup does not print any output by default. Use the
|
||||
-verbose flag for details, including timing.
|
||||
|
|
|
@ -335,13 +335,13 @@ possibly making them potentially no longer readable by the previous version.
|
|||
checkAccounts()
|
||||
checkOther()
|
||||
|
||||
if fail {
|
||||
log.Fatalf("errors were found")
|
||||
} else {
|
||||
log.Printf("%s: OK", dataDir)
|
||||
}
|
||||
|
||||
if backupmoxversion != moxvar.Version {
|
||||
log.Printf("NOTE: The backup was made with mox version %q, while verifydata was run with mox version %q. Database files have probably been modified by running mox verifydata. Make a fresh backup before upgrading.", backupmoxversion, moxvar.Version)
|
||||
}
|
||||
|
||||
if fail {
|
||||
log.Fatalf("errors were found")
|
||||
} else {
|
||||
fmt.Printf("%s: OK\n", dataDir)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue