docker-s3-backup/main.go

31 lines
482 B
Go
Raw Permalink Normal View History

2023-09-14 22:15:37 +00:00
package main
import (
"context"
"os"
"os/signal"
"syscall"
"code.jhot.me/jhot/docker-s3-backup/cmd"
"code.jhot.me/jhot/docker-s3-backup/internal"
)
var (
ctx context.Context
cancel context.CancelFunc
)
func main() {
ctx, cancel = context.WithCancel(context.Background())
go func() {
sigch := make(chan os.Signal, 1)
signal.Notify(sigch, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
<-sigch
internal.StopSchedule()
cancel()
}()
cmd.Execute(ctx)
}