Merge pull request #64 from amit-gshe/master

Optimize the systemd service script
pull/67/head
Dave Musicant 5 years ago committed by GitHub
commit 066a9f3ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,9 +84,9 @@ The `<username>` bit should be replaced with your username or that of any other
#### systemd
- If installed to a path other than `/usr/local/bin/gitwatch`, modify `gitwatch@.service` to suit
- If installed to a path other than `/usr/bin/gitwatch`, modify `gitwatch@.service` to suit
- Create dir if it does not exist and copy systemd service file with `mkdir -p "$HOME/.config/systemd/user" && cp gitwatch@.service $HOME/.config/systemd/user`
- Start and enable the service for a given path by running `systemctl --user --now enable gitwatch@$(systemd-escape "/path/to/folder/to/monitor").service`
- Start and enable the service for a given path by running `systemctl --user --now enable gitwatch@$(systemd-escape "'-r url/to/repository' /path/to/folder").service`
## Other Articles
### On the Gitwatch Wiki

@ -1,9 +1,10 @@
[Unit]
Description=Watch file or directory and git commit all changes
Description=Watch file or directory and git commit all changes. run with: systemctl --user --now enable gitwatch@$(systemd-escape "'-r url/to/repository' /path/to/folder").service
[Service]
ExecStart=/usr/local/bin/gitwatch "%I"
Environment="SCRIPT_ARGS=%I"
ExecStart=/usr/bin/gitwatch $SCRIPT_ARGS
ExecStop=/bin/true
[Install]
WantedBy=multi-user.target
WantedBy=default.target

Loading…
Cancel
Save