2
0
mirror of https://github.com/gitwatch/gitwatch synced 2024-11-17 03:25:41 +00:00

Merge pull request #64 from amit-gshe/master

Optimize the systemd service script
This commit is contained in:
Dave Musicant 2019-03-22 10:14:24 -05:00 committed by GitHub
commit 066a9f3ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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