diff --git a/take_a_still.py b/take_a_still.py new file mode 100644 index 0000000..d61c4da --- /dev/null +++ b/take_a_still.py @@ -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)) diff --git a/telescopium.service b/telescopium.service new file mode 100644 index 0000000..e4e6968 --- /dev/null +++ b/telescopium.service @@ -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 diff --git a/telescopium.timer b/telescopium.timer new file mode 100644 index 0000000..0765894 --- /dev/null +++ b/telescopium.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for taking a daily picture + +[Timer] +OnCalendar=daily +AccuracySec=1m +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/telescopium_work_log b/telescopium_work_log index 13ff795..d91e970 100644 --- a/telescopium_work_log +++ b/telescopium_work_log @@ -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/