[systemd] update webcam-script

This commit is contained in:
Felix Buehler 2018-12-11 23:23:04 +01:00
parent dbd6704926
commit 54c7c6ac00
6 changed files with 17 additions and 20 deletions

View file

@ -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 $?

View file

@ -1,9 +0,0 @@
[Unit]
Description=1hour webcam-timer
[Timer]
OnCalendar=*:0
Unit=webcam.target
[Install]
WantedBy=webcam.target

View file

@ -2,5 +2,5 @@
Description=Webcam script
[Service]
ExecStart=/home/felix/.dotfiles/cron/webcam.sh
ExecStart=/home/felix/.dotfiles/systemd/webcam.sh
Type=oneshot

8
systemd/webcam.sh Executable file
View file

@ -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 $?

8
systemd/webcam.timer Normal file
View file

@ -0,0 +1,8 @@
[Unit]
Description=1 hour webcam-timer
[Timer]
OnCalendar=*:00
[Install]
WantedBy=timers.target