Skip to content

Instantly share code, notes, and snippets.

@islands04
Created March 14, 2020 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save islands04/58a7c36f071bf6ad1bc8a31006cfdac8 to your computer and use it in GitHub Desktop.
Save islands04/58a7c36f071bf6ad1bc8a31006cfdac8 to your computer and use it in GitHub Desktop.
Calibre Content Server Systemd Scripts
[Unit]
Description=Clean Up Calibre Import Directory
After=network.target
[Service]
Type=oneshot
User=calibre
Group=calibre
ExecStart=/usr/bin/rm -f /home/calibre/mnt/downloads/books/*.cbz
ExecStart=/usr/bin/rm -f /home/calibre/mnt/downloads/books/*.cbr
[Install]
WantedBy=calibre-import-cleanup.timer
[Unit]
Description=Clean up Calibre Import Directory Timer (runs every 59 minutes)
[Timer]
OnUnitActiveSec=59min
Persistent=true
Unit=calibre-import-cleanup.service
[Install]
WantedBy=multi-user.target
[Unit]
Description=Calibre Import Service
After=network.target
[Service]
User=calibre
Group=calibre
ExecStart=/usr/bin/calibredb add /home/calibre/mnt/downloads/books --with-library http://localhost:8010/#comic-books
[Install]
WantedBy=calibre-import.timer
[Unit]
Description=Calibre Import Service Timer (runs every 9 minutes)
[Timer]
OnUnitActiveSec=9min
Persistent=true
Unit=calibre-import.service
[Install]
WantedBy=multi-user.target
[Unit]
Description=Calibre Service
After=network.target
[Service]
User=calibre
Group=calibre
Type=forking
PIDFile=/home/calibre/calibre-server.pid
ExecStart=/usr/bin/calibre-server \
--daemonize \
--max-opds-items=30 \
--max-opds-ungrouped-items=100 \
--port=8010 \
--pidfile=/home/calibre/calibre-server.pid \
--log=/dev/null \
--enable-local-write \
/home/calibre/mnt/library/comic-books/
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment