Skip to content

Commit 4d26bc6

Browse files
nils-wernerval-ms
authored andcommitted
Systemd timer for freshclam updates
1 parent b4f0836 commit 4d26bc6

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

freshclam/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,18 @@ if(SYSTEMD_FOUND)
6161
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-freshclam.service
6262
DESTINATION ${SYSTEMD_UNIT_DIR}
6363
COMPONENT programs)
64+
configure_file(
65+
${CMAKE_CURRENT_SOURCE_DIR}/clamav-freshclam-once.service.in
66+
${CMAKE_CURRENT_BINARY_DIR}/clamav-freshclam-once.service @ONLY)
67+
install(
68+
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-freshclam-once.service
69+
DESTINATION ${SYSTEMD_UNIT_DIR}
70+
COMPONENT programs)
71+
configure_file(
72+
${CMAKE_CURRENT_SOURCE_DIR}/clamav-freshclam-once.timer.in
73+
${CMAKE_CURRENT_BINARY_DIR}/clamav-freshclam-once.timer @ONLY)
74+
install(
75+
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-freshclam-once.timer
76+
DESTINATION ${SYSTEMD_UNIT_DIR}
77+
COMPONENT programs)
6478
endif()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Update ClamAV virus database once
3+
Documentation=man:freshclam(1) man:freshclam.conf(5) https://docs.clamav.net/
4+
Wants=network-online.target
5+
After=network-online.target
6+
7+
[Service]
8+
Type=oneshot
9+
ExecStart=@prefix@/bin/freshclam
10+
11+
[Install]
12+
WantedBy=multi-user.target
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Daily ClamAV virus database update
3+
4+
[Timer]
5+
OnCalendar=daily
6+
AccuracySec=1h
7+
RandomizedDelaySec=1h
8+
Persistent=true
9+
10+
[Install]
11+
WantedBy=timers.target

0 commit comments

Comments
 (0)