Skip to content

Instantly share code, notes, and snippets.

@rraallvv
Created November 5, 2018 11:48
Show Gist options
  • Save rraallvv/ff2e4b8eea5a532fb8b77a99d6366a3f to your computer and use it in GitHub Desktop.
Save rraallvv/ff2e4b8eea5a532fb8b77a99d6366a3f to your computer and use it in GitHub Desktop.
curl service unit
[Unit]
Description=CURL daemon
After=network.target
[Service]
User=myuser
Group=myuser
#CPUQuota=
#MemoryLimit=
#IOReadIOPSMax=
#IOWriteIOPSMax=
ExecStart=/usr/bin/curl --limit-rate 2M -L -O -C - https://example.com/somefile
ExecStop=/usr/bin/killall -w -s 2 /usr/bin/curl
WorkingDirectory=/home/myuser
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment