malscan/updater.go

30 lines
589 B
Go
Raw Normal View History

2023-04-06 09:35:59 +00:00
package main
import (
"log"
"os"
"os/exec"
"time"
)
func freshclam_update() {
for {
freshclam_update_routine()
time.Sleep(1 * time.Hour)
}
}
func freshclam_update_routine() {
log.Println("freshclam_update_routine(): refreshing clamav database...")
freshclamCommand := exec.Command("freshclam")
freshclamCommand.Stdout = os.Stdout
freshclamCommand.Stderr = os.Stderr
err := freshclamCommand.Run()
if err != nil {
log.Println("freshclam_update_routine(): error running freshclam:", err)
}
log.Println("freshclam_update_routine(): done refreshing clamav database")
}