Resume timer after pause
This commit is contained in:
1 parent
7e0d562d9f
commit
cf920dc76f
7 files changed
+110
-11
No files matched your search
@@ -33,9 +33,21 @@ install -o root -g root -m 0644 \
|
||||
"$ROOT_DIR/systemd/cleanup-smartcam-data.timer" \
|
||||
/etc/systemd/system/cleanup-smartcam-data.timer
|
||||
|
||||
install -o root -g root -m 0644 \
|
||||
"$ROOT_DIR/systemd/cleanup-smartcam-data-resume.timer" \
|
||||
/etc/systemd/system/cleanup-smartcam-data-resume.timer
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now cleanup-smartcam-data.timer
|
||||
|
||||
# The fast timer is started by the cleanup program only while capture is paused.
|
||||
systemctl disable cleanup-smartcam-data-resume.timer 2>/dev/null || true
|
||||
if [[ -f /var/lib/cleanup-smartcam-data/capture-paused ]]; then
|
||||
systemctl start cleanup-smartcam-data-resume.timer
|
||||
else
|
||||
systemctl stop cleanup-smartcam-data-resume.timer 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Remove obsolete installed names only after the new timer is active.
|
||||
rm -f \
|
||||
/etc/systemd/system/userdata-video-cleanup.timer \
|
||||
@@ -47,4 +59,5 @@ echo "安装完成。"
|
||||
echo "程序: /usr/local/sbin/cleanup-smartcam-data"
|
||||
echo "服务: /etc/systemd/system/cleanup-smartcam-data.service"
|
||||
echo "定时器: /etc/systemd/system/cleanup-smartcam-data.timer"
|
||||
echo "暂停恢复定时器: /etc/systemd/system/cleanup-smartcam-data-resume.timer"
|
||||
systemctl --no-pager status cleanup-smartcam-data.timer || true
|
||||
Reference in new issue
Block a user