gengxin
This commit is contained in:
1 parent
c460ae8fbd
commit
71c4711282
6 files changed
+303
-95
No files matched your search
+5
-8
@@ -15,11 +15,6 @@ bash -n "$ROOT_DIR/bin/cleanup-smartcam-data"
|
||||
systemctl disable --now userdata-video-cleanup.timer 2>/dev/null || true
|
||||
|
||||
install -d -o root -g root -m 0755 /var/lib/cleanup-smartcam-data
|
||||
if [[ -f /var/lib/userdata-video-cleanup/capture-paused && \
|
||||
! -f /var/lib/cleanup-smartcam-data/capture-paused ]]; then
|
||||
mv /var/lib/userdata-video-cleanup/capture-paused \
|
||||
/var/lib/cleanup-smartcam-data/capture-paused
|
||||
fi
|
||||
|
||||
install -o root -g root -m 0755 \
|
||||
"$ROOT_DIR/bin/cleanup-smartcam-data" \
|
||||
@@ -40,9 +35,11 @@ install -o root -g root -m 0644 \
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now cleanup-smartcam-data.timer
|
||||
|
||||
# The fast timer is started by the cleanup program only while capture is paused.
|
||||
# The fast timer is started only while low disk space disables local recording.
|
||||
systemctl disable cleanup-smartcam-data-resume.timer 2>/dev/null || true
|
||||
if [[ -f /var/lib/cleanup-smartcam-data/capture-paused ]]; then
|
||||
if [[ -f /userdata/data/.recording-paused-low-disk || \
|
||||
-f /var/lib/cleanup-smartcam-data/capture-paused || \
|
||||
-f /var/lib/userdata-video-cleanup/capture-paused ]]; then
|
||||
systemctl start cleanup-smartcam-data-resume.timer
|
||||
else
|
||||
systemctl stop cleanup-smartcam-data-resume.timer 2>/dev/null || true
|
||||
@@ -59,5 +56,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"
|
||||
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