mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 00:30:29 +01:00
25 lines
540 B
Go
25 lines
540 B
Go
// Copyright 2021-2022 - offen.software <hioffen@posteo.de>
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
)
|
|
|
|
func main() {
|
|
foreground := flag.Bool("foreground", false, "run the tool in the foreground")
|
|
profile := flag.String("profile", "", "collect runtime metrics and log them periodically on the given cron expression")
|
|
flag.Parse()
|
|
|
|
c := newCommand()
|
|
if *foreground {
|
|
opts := foregroundOpts{
|
|
profileCronExpression: *profile,
|
|
}
|
|
c.must(c.runInForeground(opts))
|
|
} else {
|
|
c.must(c.runAsCommand())
|
|
}
|
|
}
|