Is there a way to sync files/folders in Linux?

Discussion in 'Systems Administration' started by William79, Jun 14, 2015.

  1. Hey again folks,

    Sorry for posting another question only a day later, but I have another question -- is there a way to "sync" files and folders in Linux, or more specifically in my case, Debian? I have a small BungeeCord network, but it's absolutely horrible having to upload the same plugin to 5 servers to update them all, then re-do the configuration for some plugins and then have to repaste them on 5 different servers. It's inefficient and such a waste of time.

    Is there a way I could make a folder called "Spigot Plugins," for example, and have certain plugin jars and configurations/folders in it? Then, have it sync those files to the plugin folders of each server?

    An example would be:

    /home/Minecraft Servers/Survival/plugins/WorldEdit.jar/ updates from the directory /home/Spigot Plugins/WorldEdit.jar

    This way whenever I want to update WorldEdit for example, I simply upload the WorldEdit.jar to "/home/Spigot Plugins/" and then restart all of my servers, and boom -- it updates to the new jar file.

    Is this possible somehow? Any help would be great!

    Many thanks again,
    ~ Will
  2. You mean have like a central /plugins folder that will distribute to all servers? Yes this is possible, but do all of your servers share the same plugins exactly?

    Look into the using 'tee' you can copy files to multiple folders with it
    Code (Text):

    tee ~/folder1/test.txt ~/folder2/test.txt < ~/test.txt
  3. Well, no, they don't share the same plugins *exactly* only some, such as WorldEdit and WorldGuard.
  4. You could create a folder with the spigot jar and plugins jars and customized configs that you'd use on every single server and then link using symbolic links. But popular FTP clients don't handle symbolic links well, plus it can lead to massive data loss if you accidentally delete something.

    Personally I'd stick with just uploading the configuration several times, it'd take much less work overall.