added a python script to take a picture, plus service and timer for running it daily
This commit is contained in:
parent
5b59cade63
commit
e2eac258d7
7
take_a_still.py
Normal file
7
take_a_still.py
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/python3
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
filename = os.popen("date +%+4Y-%m-%d-%Hh%Mm.jpg").read()
|
||||
|
||||
os.system("libcamera-jpeg -o /var/www/html/stills/{}".format(filename))
|
11
telescopium.service
Normal file
11
telescopium.service
Normal file
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=take a picture every day
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
WorkingDirectory = /home/shoofle/telescopium
|
||||
ExecStart=python /home/shoofle/telescopium/take_a_still.py
|
||||
User=shoofle
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
10
telescopium.timer
Normal file
10
telescopium.timer
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Timer for taking a daily picture
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
AccuracySec=1m
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
@ -16,4 +16,4 @@ command for outputting a datetime filename: date +%+4Y-%m-%d-%Hh%Mm.jpg
|
||||
|
||||
added a listing for autoindexing the folder /var/www/html/stills/ with location /stills/ { autoindex: on; }
|
||||
|
||||
|
||||
made a python script to take a picture, plus a systemd service and timer to take pictures daily! they need to be symlinked into /etc/systemd/system/
|
||||
|
Loading…
Reference in New Issue
Block a user