Aller au contenu

Drafts d'oliv

logrotate

/etc/logrotate.d/irssi
/home/dl/irssi/logs/Abjects/#moviegods.log {
  prerotate
        /home/dl/flexget/getSeriesFromBot Abjects moviegods

  endscript
  rotate 0
  copytruncate
  size 150k
  missingok
  notifempty
}

systemd / systemctl

  • Exemple

    /etc/systemd/system/pyload.service
    [Unit]
    Description=Downloadtool for One-Click-Hoster written in python.
    After=network.target
    
    [Service]
    ExecStart=/usr/bin/python /home/dl/pyload/pyLoadCore --configdir=/home/dl/pyload/.pyload
    User=dl
    Group=dl
    
    [Install]
    WantedBy=multi-user.target
    

  • Autre exemple avec plus de trucs dans "Service"

    [Service]
    User=dl
    Group=dl
    # Run ExecStartPre with root-permissions
    PermissionsStartOnly=true
    ExecStartPre=/bin/mkdir -p /var/run/sabnzbd/
    ExecStartPre=/bin/chown -R dl.dl /var/run/sabnzbd/
    ExecStart=/usr/bin/python2.7 /home/dl/newsgroup/SABnzbd/SABnzbd.py --config-file /home/dl/newsgroup/SABnzbd/sabnzbd.ini --logging 2 --daemon  --pid /var/run/sabnzbd/   --pidfile /
    var/run/sabnzbd/sabnzbd-10988.pid
    #ExecStart=/usr/bin/python2.7 /home/dl/newsgroup/SABnzbd/SABnzbd.py --config-file /home/dl/newsgroup/SABnzbd/sabnzbd.ini --logging 2 --daemon --pid /var/run/sabnzbd/   --pidfile /
    var/run/sabnzbd/sabnzbd-10987.pid
    PIDFile=/var/run/sabnzbd/sabnzbd-10988.pid
    Type=forking
    #TimeoutStartSec=600s
    

  • Autre exemple pour un jar

https://superuser.com/questions/944244/running-a-java-process-from-systemd

init.d

Pour faire un init.d sur un jar : http://www.jcgonzalez.com/linux-java-service-wrapper-example

incrontab

/Series/720p IN_CLOSE_WRITE /root/kodi_update
/Series/720p IN_DELETE /root/kodi_delete
/root/kodi_update
#!/bin/sh

curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://192.168.1.200:8080/jsonrpc