ExecStart=/usr/bin/flock --nonblock /tmp/<lock filename>.lock <script with absolute path>
ExecStop=
+
+
[Install]
+
WantedBy=multi-user.target|timers.target
```
- wants/after network-online.target mean that this service needs the network to be online
- Type `oneshot` is for short running tasks like backup scripts, `simple` for permanently running things like server and databases
- additional line `RemainAfterExit=yes` would be for things like `mount` which result is *active* even if the service has exited - then also an additional lne for `ExecStop` would be necessary to `unmount` the service
+
- Environment could also be directory of python (inside a virtual environment)
- flock create lock file to prevent different backups running in parallel
- nonblock means, that additional starts doesn't wait but stop executing
+
- `Restart=on-failure` means restart if service crashed
+
- `RestartSec=5` delay for automatic restart
+
- `Install WantedBy` tells the service what to do when `systemctl enable` is called