Skip to content

Run as service on Debian based distro

Using systemd

Warning

Make sure to follow the instructions to install from binary before.

To create a new service, paste this content in /etc/systemd/system/ftpgrab.service:

[Unit]
Description=FTPGrab
Documentation=https://crazymax.dev/ftpgrab/
After=syslog.target
After=network.target

[Service]
RestartSec=2s
Type=simple
User=ftpgrab
Group=ftpgrab
ExecStart=/usr/local/bin/ftpgrab --config /etc/ftpgrab/ftpgrab.yml --schedule "*/30 * * * *" --log-level info
Restart=always
#Environment=TZ=Europe/Paris
Environment=LOG_TIMESTAMP=false
Environment=FTPGRAB_DB_PATH=/var/lib/ftpgrab/ftpgrab.db

[Install]
WantedBy=multi-user.target

Change the user, group, and other required startup values following your needs.

Enable and start FTPGrab at boot:

sudo systemctl enable ftpgrab
sudo systemctl start ftpgrab

To view logs:

journalctl -fu ftpgrab.service

Last update: 2021-04-25 21:26:36
Created: 2020-07-07 20:06:09