Skip to content

Instantly share code, notes, and snippets.

@delpinoconsulting
Last active March 23, 2021 18:02
Show Gist options
  • Save delpinoconsulting/127d0f23ae49fb238430ee7174aa8b18 to your computer and use it in GitHub Desktop.
Save delpinoconsulting/127d0f23ae49fb238430ee7174aa8b18 to your computer and use it in GitHub Desktop.
# Install Unison
sudo apt install unison
# Install Fsmonitor
sudo pip install fsmonitor
# /etc/systemd/system/unison@.service
# 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