aggiunta gestione del PID
This commit is contained in:
parent
2e53d3fb4f
commit
1b1736a2e4
2 changed files with 22 additions and 13 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
_VERSION = "v1.3.1"
|
||||
_VERSION = "v1.3.2"
|
||||
_tformat = "2006-01-02"
|
||||
_24h = (time.Hour * 23) + (time.Minute * 59) + (time.Second * 59)
|
||||
_10m = (time.Minute * 10)
|
||||
|
@ -29,6 +29,8 @@ var (
|
|||
Batch: 10000,
|
||||
}
|
||||
|
||||
loop []bool
|
||||
|
||||
dbs = Dbs{}
|
||||
|
||||
idb = InfluxdbOutput{
|
||||
|
@ -57,6 +59,8 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
setTerm()
|
||||
|
||||
fs, err := os.OpenFile(opts.LogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
fmt.Println("Log file error: ", err.Error())
|
||||
|
@ -65,6 +69,9 @@ func main() {
|
|||
|
||||
log.SetOutput(fs)
|
||||
|
||||
pid.Write(true)
|
||||
defer pid.Remove()
|
||||
|
||||
start := time.Now()
|
||||
fmt.Printf("Start: %+v\n", opts)
|
||||
log.Printf("Start: %+v\n", opts)
|
||||
|
|
26
options.go
26
options.go
|
@ -13,18 +13,20 @@ import (
|
|||
)
|
||||
|
||||
type Options struct {
|
||||
MongoSrc string
|
||||
MongoDst string
|
||||
StartDate string
|
||||
Duration time.Duration
|
||||
Interval time.Duration
|
||||
LogFile string
|
||||
Influxdb string
|
||||
Hostname string
|
||||
Version bool
|
||||
Debug bool
|
||||
Bulk bool
|
||||
Batch int
|
||||
MongoSrc string
|
||||
MongoDst string
|
||||
StartDate string
|
||||
Duration time.Duration
|
||||
Interval time.Duration
|
||||
LogFile string
|
||||
Influxdb string
|
||||
Hostname string
|
||||
Version bool
|
||||
Debug bool
|
||||
Bulk bool
|
||||
Batch int
|
||||
Exe string
|
||||
Concurrent int
|
||||
}
|
||||
|
||||
func usage() {
|
||||
|
|
Loading…
Add table
Reference in a new issue