How to workaround file system sync stopping?

Operating system

Windows

Joplin version

2.13.15

Desktop version info

Joplin 2.13.15 (prod, win32)

Client ID: b5cb3b24a33546a18d1ea28081fb7cc0
Sync Version: 3
Profile Version: 44
Keychain Supported: Yes

Revision: 7d2c1c0

Note Tabs: 1.4.0
Plugin Bundle: 0.5.5
Simple Backup: 1.3.6

Sync target

File system

Editor

Markdown Editor

What issue do you have?

This one : Sync silently ignores new files with old timestamps · Issue #6517 · laurent22/joplin · GitHub. It seems joplin just stops syncing. How can I work around it ?

The workaround is already explained in the GitHub issue. In short, you need to keep updating MD files modified date to the future to force Joplin index them. Granted, the solution requires you to be at least a bit tech-savvy, but there is no alternative at the moment.

How can I do it regularly ? Has anyone done it ? eg : Schedule the task daily or something ?

Yeah, you can create a new task in the Task Scheduler, e.g. you can embed this script

while ($true) {
	Get-ChildItem -Path (Join-Path -Path '<path-to-notes-folder>' -ChildPath '*.md') -File | ForEach-Object { if ($_.LastWriteTime.AddMinutes(5) -le (Get-Date)) { $_.LastWriteTime = (Get-Date).AddYears(1) }}
	Start-Sleep -Seconds 60
}

into the task by setting the command to powershell.exe and the arguments to -Command "& {while ($true) {Get-ChildItem -Path (Join-Path -Path '<path-to-notes-folder>' -ChildPath '*.md') -File | ForEach-Object { if ($_.LastWriteTime.AddMinutes(5) -le (Get-Date)) { $_.LastWriteTime = (Get-Date).AddYears(1) }};Start-Sleep -Seconds 60}}".

Then, set the task to run on startup or your user logon. Every 60 seconds, it will keep updating timestamps of the files which haven't been touched in the last 5 minutes (to prevent potential sync conflicts by touching files that are being edited at the very moment) to exactly 1 year from now. Of course, you need to use your actual Joplin filesystem sync path in the <path-to-notes-folder>.

I would also strongly recommend making a backup copy of the whole folder before actually experimenting with the script.

Thank you very much.

If I increase Start-Sleep -Seconds 60 duration, it will update less frequently right ? I need to do this once every day, so Start-Sleep -Seconds 86400 ?

Yep, although for once a day, you could just shorten the whole command to -Command "& {Get-ChildItem -Path (Join-Path -Path '<path-to-notes-folder>' -ChildPath '*.md') -File | ForEach-Object { if ($_.LastWriteTime.AddMinutes(5) -le (Get-Date)) { $_.LastWriteTime = (Get-Date).AddYears(1) }}}" and set the task to run periodically once per day :slight_smile:. The difference is that this way, you won't have a PowerShell window hanging there all the time in the background, taking RAM.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.