From 54c7c6ac000fa8b0a29214a03e22cbab44b84b5d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 11 Dec 2018 23:23:04 +0100 Subject: [PATCH] [systemd] update webcam-script --- cron/webcam.sh | 10 ---------- cron/webcam.timer | 9 --------- {cron => systemd}/webcam-install.sh | 0 {cron => systemd}/webcam.service | 2 +- systemd/webcam.sh | 8 ++++++++ systemd/webcam.timer | 8 ++++++++ 6 files changed, 17 insertions(+), 20 deletions(-) delete mode 100755 cron/webcam.sh delete mode 100644 cron/webcam.timer rename {cron => systemd}/webcam-install.sh (100%) rename {cron => systemd}/webcam.service (53%) create mode 100755 systemd/webcam.sh create mode 100644 systemd/webcam.timer diff --git a/cron/webcam.sh b/cron/webcam.sh deleted file mode 100755 index 9b96edb..0000000 --- a/cron/webcam.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -## 0 * * * * ~/.dotfiles/cron/webcam.sh -now=$(date +"%Y_%m_%d_%H_%M_%S") -path="$HOME/Pictures/hour-pics" -size="1280x720" -basename=$(dirname $(readlink -f $0)) - -mkdir -p $path -streamer -q -f jpeg -s $size -o $path/$now.jpeg -r 1 -exit $? diff --git a/cron/webcam.timer b/cron/webcam.timer deleted file mode 100644 index d7315b6..0000000 --- a/cron/webcam.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=1hour webcam-timer - -[Timer] -OnCalendar=*:0 -Unit=webcam.target - -[Install] -WantedBy=webcam.target diff --git a/cron/webcam-install.sh b/systemd/webcam-install.sh similarity index 100% rename from cron/webcam-install.sh rename to systemd/webcam-install.sh diff --git a/cron/webcam.service b/systemd/webcam.service similarity index 53% rename from cron/webcam.service rename to systemd/webcam.service index 450021e..af28978 100644 --- a/cron/webcam.service +++ b/systemd/webcam.service @@ -2,5 +2,5 @@ Description=Webcam script [Service] -ExecStart=/home/felix/.dotfiles/cron/webcam.sh +ExecStart=/home/felix/.dotfiles/systemd/webcam.sh Type=oneshot diff --git a/systemd/webcam.sh b/systemd/webcam.sh new file mode 100755 index 0000000..10c2957 --- /dev/null +++ b/systemd/webcam.sh @@ -0,0 +1,8 @@ +#!/bin/bash +now=$(date +"%Y_%m_%d_%H_%M_%S") +path="$HOME/Pictures/hour-pics" +size="1280x720" + +mkdir -p "$path" +streamer -q -f jpeg -s $size -o "$path"/"$now".jpeg -r 1 +exit $? diff --git a/systemd/webcam.timer b/systemd/webcam.timer new file mode 100644 index 0000000..925f53a --- /dev/null +++ b/systemd/webcam.timer @@ -0,0 +1,8 @@ +[Unit] +Description=1 hour webcam-timer + +[Timer] +OnCalendar=*:00 + +[Install] +WantedBy=timers.target