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/artifactory-cleanup.service:

[Unit]
Description=artifactory-cleanup
Documentation=https://crazymax.dev/artifactory-cleanup/
After=syslog.target
After=network.target

[Service]
RestartSec=2s
Type=simple
User=artifactory-cleanup
Group=artifactory-cleanup
ExecStart=/usr/local/bin/artifactory-cleanup --config /etc/artifactory-cleanup/artifactory-cleanup.yml
Restart=always
#Environment=TZ=Europe/Paris

[Install]
WantedBy=multi-user.target

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

Enable and start artifactory-cleanup at boot:

sudo systemctl enable artifactory-cleanup
sudo systemctl start artifactory-cleanup

To view logs:

journalctl -fu artifactory-cleanup.service

Last update: 2021-04-25 01:38:55
Created: 2020-09-24 14:21:34