Created
February 20, 2018 10:51
-
-
Save thunfischbrot/0b6a21a84f166c4fa74fc5df4a470b17 to your computer and use it in GitHub Desktop.
Unison systemd service
This file contains 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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to see if I can use unison with systemd. I'm reading up on systemd but have not encountered the following aspect yet. What if unison finds a conflict and asks the user to chose between the remote or the local version of a file? Is there a way to interact with the systemd unison service to tell it to chose e.g. the remote version?