๐ Most efficient solution for syncing a small directory with a cloud storage remote, from several servers at once? Ubuntu (headless) on Google Cloud VMs
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
I run some game servers, they are all separate VM instances hosted using Google Cloud service. On each one there's a 'servervault' directory which contains individual subdirectories that store every player's characters' files; one file per character. It's not a huge directory (about 2mb but slowly growing; perhaps 100 files).
โ
These servers are all linked - players can travel with their characters from one server to the next. In practical terms this means that the contents of the 'servervault' directory needs to be kept synchronised across all servers at all times.
โ
The only times the contents of 'servervault' are updated are when:
- a player logs out of the server - this makes the server application save and close their character's file;
- a player creates a new character - this results in the creation of a new character file within a player's subdirectory;
- a new player logs in and creates their first character - new subdirectory & new character file is created;
- I manually delete some character files (basically never needed).
โ
If I were running on Windows, this would be incredibly simple - just mount the 'servervault' directory on Google Drive using the Backup and Sync application, on each server. Whenever any of the above events happen on any server, Backup and Sync will quickly upload the latest version of whatever character file/subdirectory has been modified. When a player transfers a character from one server to the other, they'll be sure to find their character waiting for them on the destination server.
โ
On Linux it seems like a nightmare to get this working because Google has never made a native Linux backup & sync application. I tried Ocamlfuse, which mounts the directory and does everything I need, but it had a noticeable impact on performance.
I thought running RClone using INotifyWait would work, but RClone doesn't actually do conflict checks to see whether the remote or local directories has the latest version of each file - instead it just either blanket copies or does a blanket sync.
โ
So, question:
- is Insync my solution? It sounds like it does a proper, conflict-checking two-way sync that will allow me to ensure only the latest character file version is kept. I can run it using an INotifyWait monitoring routine on the 'servervault' directory & subdirectories.
- I heard that Insync dropped headless Linux support and only recently brought it back... this does not sound great if I'm paying for a bit of software.
- alternatively, should I just use Dropbox instead of Google Drive? I heard Dropbox have recently released a native headless Linux client - sounds like this might be ideal for my purposes? Does anyone know how the performance is?
- as another alternative, does anyone who's used Google's Cloud service for hosting VM servers know whether there's something native there that would be better suited for this? I know there are storage buckets and things but I'm a total newbie at all this and their documentation goes way over my head.
[link] [comments] ...