added a python script to take a picture, plus service and timer for running it daily

main
Shoofle 3 years ago
parent 5b59cade63
commit e2eac258d7
  1. 7
      take_a_still.py
  2. 11
      telescopium.service
  3. 10
      telescopium.timer
  4. 2
      telescopium_work_log

@ -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))

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

@ -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…
Cancel
Save