joplin-plugin-hotfolder icon indicating copy to clipboard operation
joplin-plugin-hotfolder copied to clipboard

Directory on usb stick is not recognized after disconnect

Open th-ros opened this issue 2 years ago • 0 comments

Hello,

I made a test with a hotfolder directory on an usb stick. After configuring the hotfolder and the usb stick is connected everthing works fine. Then I remove the stick and reconnect it and then the hotfolder plugin don't recognize new files in the directory.

What will I do?

Because of home office I have two notebooks on my desk and I use them with an external keyboard and mouse via a usb switch. Also I connected a usb stick to the usb switch and I can easily copy files from notebook1 to notebook2. Always when I switch to the other notebook the usb stick is connected and I can use this drive. On both notebooks I use a (not shared) joplin (one for work and one private).

But somethimes at work I will create a short private note. Or in the evening I work with my private notebook and I will write a note for work.

My idea is to use this usb stick to transfer easily notes from one notebook to the other always when I switch my notebooks with the usb switch. To create new notes I use a very simple self written python script which adds normaly new notes via joplin api to joplin. I will modify it to save the note a) via joplin api to the local joplin or b) to the usb stick to a directory d:\joplin_hotfolder_work or d:\joplin_hotfolder_private. So next time I switch to the other notebook the notes will be imported by hotfolder plugin.

But the problem is the plugin won't recognise the "reconnected" usb stick.

Solution?

I checked the source code of hotfolder plugin a little bit and saw that i uses the chokidar module. Mabye the problem ist the watch mode and this ins't working with usb sticks or network drives. Perhaps the usePolling = true option will fix this behavior for usb sticks.

If this is the reason for not recognizing the reconnected usb stick, maybe a config switch for "special directories like dirs on usb sticks, network drives, ..." will enable the polling option (only for that folder). And also a config for "polling in x seconds" make sense - for me 60 seconds is enough.

I would be very cool if I can realise my idea this this "simple note transfer". Because of vpn for my work notebook it isn't possible to share drives in the same network so this solution with this parallel used usb stick seems very interessting.

My versions:

  • Joplin Windows (Portable) v2.7.14
  • Hotfolder Plugin v1.0.1
  • Windows 10 and Windows 11

Some informations: https://github.com/paulmillr/chokidar/issues/315#issuecomment-125523806 https://github.com/paulmillr/chokidar/issues/225#issuecomment-73288215

Bye Thomas

th-ros avatar Mar 15 '22 16:03 th-ros