This repository has been archived on 2023-11-11. You can view files and clone it, but cannot push or open issues or pull requests.
automated-youtube-dl/Example systemd Service.md

32 lines
658 B
Markdown
Raw Normal View History

2023-01-20 21:42:36 -07:00
# Example systemd Service
`/home/user/youtubedl-daemon.sh`
```bash
#!/bin/bash
2023-01-21 18:27:01 -07:00
/usr/bin/python3 /home/user/automated-youtube-dl/downloader.py --daemon --silence-errors --sleep 60 "https://www.youtube.com/playlist?list=example12345" "/mnt/nfs/archive/YouTube/Example Playlist/"
2023-01-20 21:42:36 -07:00
```
`/lib/systemd/system/youtubedl.service`
```systemd
[Unit]
Description=Youtube-DL Daemon
After=network-online.target
[Service]
ExecStart=/home/user/youtubedl-daemon.sh
User=user
Group=user
[Install]
WantedBy=multi-user.target
```
Now start the service
```bash
chmod +x /home/user/youtubedl-daemon.sh
sudo systemctl daemon-reload
sudo systemctl enable --now youtubedl
```