Unison Not Consistently Detecting New Files and Changes

Preamble

I’m using Unison for file synchronization between my local MacBook Pro and a remote server. The synchronization is inconsistent: sometimes it works perfectly, but other times it stops detecting changes.

Unison sometimes fails to detect new files added to the remote directory, though it picks up changes from the local directory usually, but sometimes even then, it doesn’t. For example, it did not detect “cs241/a1/a1q5/self-modifying.mips”. I killed the process and restarted it using a script with nohup. This temporarily resolved the issue, but after a few minutes, Unison stopped detecting remote changes again, though local changes were still synchronized.

Question:

Why does Unison inconsistently detect new files, and how can I ensure it always picks up changes?

Additional Information:

Unison version: 2.53.5
Configuration includes repeat = watch for real-time monitoring.

Any insights or suggestions would be greatly appreciated

Unison log Excerpt:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Unison 2.53.5 (ocaml 5.1.0): Contacting server...
Connected [//local-machine.local//Users/username/uw -> //remote-server//remote/path]
Looking for changes
Waiting for changes from server
Reconciling changes
<---- new file **cs241/a1/a1q5/self-modifying.mips**
1 items will be synced, 0 skipped
0 B to be synced from local to remote-server
36 B to be synced from remote-server to local
Propagating updates
Unison 2.53.5 (ocaml 5.1.0) started propagating changes at 20:43:21.62 on 19 May 2024
[BGN] Copying cs241/a1/a1q5/self-modifying.mips from //remote-server//remote/path to /Users/username/uw
[END] Copying cs241/a1/a1q5/self-modifying.mips
Unison 2.53.5 (ocaml 5.1.0) finished propagating changes at 20:43:21.73 on 19 May 2024, 0.119 s
Saving synchronizer state
Synchronization complete at 20:43:21 (1 item transferred, 0 skipped, 0 failed)
Looking for changes
Waiting for changes from server
Reconciling changes
Nothing to do: replicas have not changed since last sync.
</code>
<code>Unison 2.53.5 (ocaml 5.1.0): Contacting server... Connected [//local-machine.local//Users/username/uw -> //remote-server//remote/path] Looking for changes Waiting for changes from server Reconciling changes <---- new file **cs241/a1/a1q5/self-modifying.mips** 1 items will be synced, 0 skipped 0 B to be synced from local to remote-server 36 B to be synced from remote-server to local Propagating updates Unison 2.53.5 (ocaml 5.1.0) started propagating changes at 20:43:21.62 on 19 May 2024 [BGN] Copying cs241/a1/a1q5/self-modifying.mips from //remote-server//remote/path to /Users/username/uw [END] Copying cs241/a1/a1q5/self-modifying.mips Unison 2.53.5 (ocaml 5.1.0) finished propagating changes at 20:43:21.73 on 19 May 2024, 0.119 s Saving synchronizer state Synchronization complete at 20:43:21 (1 item transferred, 0 skipped, 0 failed) Looking for changes Waiting for changes from server Reconciling changes Nothing to do: replicas have not changed since last sync. </code>
Unison 2.53.5 (ocaml 5.1.0): Contacting server...
Connected [//local-machine.local//Users/username/uw -> //remote-server//remote/path]

Looking for changes
  Waiting for changes from server
Reconciling changes
         <---- new file   **cs241/a1/a1q5/self-modifying.mips**

1 items will be synced, 0 skipped
0 B to be synced from local to remote-server
36 B to be synced from remote-server to local
Propagating updates
Unison 2.53.5 (ocaml 5.1.0) started propagating changes at 20:43:21.62 on 19 May 2024
[BGN] Copying cs241/a1/a1q5/self-modifying.mips from //remote-server//remote/path to /Users/username/uw
[END] Copying cs241/a1/a1q5/self-modifying.mips
Unison 2.53.5 (ocaml 5.1.0) finished propagating changes at 20:43:21.73 on 19 May 2024, 0.119 s
Saving synchronizer state
Synchronization complete at 20:43:21  (1 item transferred, 0 skipped, 0 failed)
Looking for changes
  Waiting for changes from server
Reconciling changes
Nothing to do: replicas have not changed since last sync.

Processes running:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ps aux | grep unison
username 3132 0.0 0.0 410724048 1344 s001 S+ 9:16pm 0:00.00 grep unison
username 3019 0.0 0.1 411474560 12800 s001 SN 8:43pm 0:00.94 /opt/homebrew/Cellar/[email protected]/3.9.19/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python /opt/homebrew/bin/unison-fsmonitor
username 3018 0.0 0.0 411175072 4048 s001 SN 8:43pm 0:00.13 ssh -l remoteuser remote.server.com -e none unison -server __new-rpc-mode
username 3011 0.0 0.0 412093776 4832 s001 SN 8:43pm 0:00.32 unison sync.prf
...
</code>
<code>ps aux | grep unison username 3132 0.0 0.0 410724048 1344 s001 S+ 9:16pm 0:00.00 grep unison username 3019 0.0 0.1 411474560 12800 s001 SN 8:43pm 0:00.94 /opt/homebrew/Cellar/[email protected]/3.9.19/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python /opt/homebrew/bin/unison-fsmonitor username 3018 0.0 0.0 411175072 4048 s001 SN 8:43pm 0:00.13 ssh -l remoteuser remote.server.com -e none unison -server __new-rpc-mode username 3011 0.0 0.0 412093776 4832 s001 SN 8:43pm 0:00.32 unison sync.prf ... </code>
ps aux | grep unison
username      3132   0.0  0.0 410724048   1344 s001  S+    9:16pm   0:00.00 grep unison
username      3019   0.0  0.1 411474560  12800 s001  SN    8:43pm   0:00.94 /opt/homebrew/Cellar/[email protected]/3.9.19/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python /opt/homebrew/bin/unison-fsmonitor
username      3018   0.0  0.0 411175072   4048 s001  SN    8:43pm   0:00.13 ssh -l remoteuser remote.server.com -e none unison -server __new-rpc-mode
username      3011   0.0  0.0 412093776   4832 s001  SN    8:43pm   0:00.32 unison sync.prf

...

This script is sourced in my ~/.zshrc:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>#!/bin/zsh
#Define the log file path
LOG_FILE="/Users/username/Library/Application Support/Unison/unison.log"
#Check if a Unison process is already running
if pgrep -f "unison sync.prf" > /dev/null; then
echo "Unison UW Sync process is already running. Exiting."
exit 1
else
#Start the Unison process with nohup
nohup unison sync.prf > "$LOG_FILE" 2>&1 &
echo "Unison UW Sync process started."
fi
</code>
<code>#!/bin/zsh #Define the log file path LOG_FILE="/Users/username/Library/Application Support/Unison/unison.log" #Check if a Unison process is already running if pgrep -f "unison sync.prf" > /dev/null; then echo "Unison UW Sync process is already running. Exiting." exit 1 else #Start the Unison process with nohup nohup unison sync.prf > "$LOG_FILE" 2>&1 & echo "Unison UW Sync process started." fi </code>
#!/bin/zsh

#Define the log file path
LOG_FILE="/Users/username/Library/Application Support/Unison/unison.log"

#Check if a Unison process is already running
if pgrep -f "unison sync.prf" > /dev/null; then
  echo "Unison UW Sync process is already running. Exiting."
  exit 1
else
  #Start the Unison process with nohup
  nohup unison sync.prf > "$LOG_FILE" 2>&1 &
  echo "Unison UW Sync process started."
fi

Sync.prf

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>#Root directories
root = /Users/username/uw
root = ssh://[email protected]//directory
#Automatically synchronize changes
auto = true
batch = true
repeat = watch
#Ignore dot files
ignore = Name .*
</code>
<code>#Root directories root = /Users/username/uw root = ssh://[email protected]//directory #Automatically synchronize changes auto = true batch = true repeat = watch #Ignore dot files ignore = Name .* </code>
#Root directories
root = /Users/username/uw
root = ssh://[email protected]//directory

#Automatically synchronize changes
auto = true
batch = true
repeat = watch

#Ignore dot files
ignore = Name .*

What I’ve Tried:

  • Ensured unison-fsmonitor is running.
  • Checked the Unison log for errors or warnings.
  • Verified network connectivity and permissions.
  • Restarted the Unison process multiple times.
  • Killed the process using pkill -f unison and then restarted it using nohup unison sync.prf > /Users/username/Library/Application Support/Unison/unison.log 2>&1 &.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật