Created
February 20, 2018 10:51
-
-
Save thunfischbrot/0b6a21a84f166c4fa74fc5df4a470b17 to your computer and use it in GitHub Desktop.
Unison systemd service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/[email protected] | |
# Starts unison with the .prf-config of your choice | |
# Create a unison .prf-config such as | |
# https://gist.github.com/thunfischbrot/3efbd4a87785615a61e4f5fd875f2699 | |
# Set the HOME Environment variable below to the user's home dir | |
# Reload systemd services | |
# systemctl daemon-reload | |
# Start service with name of your .prf | |
# systemctl start unison@20Documents | |
# systemctl status | |
# If it is working, add to startup | |
# systemctl enable unison@20Documents | |
[Unit] | |
Description=Unison File Synchronization | |
After=network.target | |
[Service] | |
Type=simple | |
Environment="PATH=/usr/local/bin:/usr/bin" | |
# Change to home directory of your user in which the .unison/*.prf files are located | |
Environment="HOME=/root" | |
ExecStart=/usr/local/bin/unison %i | |
Restart=always | |
RestartSec=7 | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from unison -help :
How to sync:
-batch batch mode: ask no questions at all
I use the following command : unison -batch -ui text profile -repeat watch