alexhartm / tonie-podcast-sync

allows synching podcast episodes to Toniebox creative tonies
https://pypi.org/project/tonie-podcast-sync/
MIT License
27 stars 4 forks source link

Schedule updating tonies using systemd #27

Open schmidttrick opened 1 month ago

schmidttrick commented 1 month ago

Hi I‘m trying to schedule the updating process of the tonies using systemd.

I created a „.service“ file but it doesn‘t work. Can anyone help me getting it running? Perhaps poste how the „.service“ file should look like.

Note: I installed the Tonie-Podcast-Sync in a venv.

alexhartm commented 1 month ago

Hi @schmidttrick This is how my service files looks like:

/etc/systemd/system/tps.service

[Unit]
Description=Run tonie-podcast-sync

[Service]
WorkingDirectory=/opt/tps
ExecStart=/home/myusername/.pyenv/shims/python /opt/tps/tps.py
User=myusername
Group=myusergroup

[Install]
WantedBy=multi-user.target

... and the corresponding systemd timer:

/etc/systemd/system/tps.timer

[Unit]
Description=Run tonie-podcast-sync script Mo-Thu and Sun at 17:00

[Timer]
OnCalendar=Mon..Thu,Sun *-*-* 17:50:00
Persistent=true

[Install]
WantedBy=timer

I have not changed my setup to use the CLI but use a self-written python file (tps.py) to trigger the upload. So you might want to change ExecStart according to your needs (e.g. directly calling tonie-podcast-sync instead).