Synchronizing access to shared, remote resource
0
votes
1
answer
275
views
I have a shared cache on a remote server that multiple clients are reading and writing to, so I need to synchronize access to this cache. I imagine I could:
1. SSH into the remote and acquire a flock on the server
2. Push the update to the server (rsync)
3. Release the flock
The flock itself is working, but in order for the entire thing to work I need a way to start a process on the remote, that can acquire and hold the lock while I update the cache from the client. The flock should then be released from client in 3. or if the connection to the client is lost. Any ideas for how to accomplish this?
Btw: In my current setup it is not possible for the server to connect to the client and 'pull' the update over SSH allowing everything to be handled in a single script executed on the remote.
Asked by mola
(101 rep)
Sep 22, 2021, 01:46 PM
Last activity: Sep 23, 2021, 01:06 PM
Last activity: Sep 23, 2021, 01:06 PM