Linux auto sync folders2/19/2023 ![]() ![]() In a production environment, the administrator will need to determine his/her best course for security and deploy appropriately. To keep two folders in synchrony, not only do we need to add the new files in the source folder to the destination folder, as in the past topics, we also need. For the sake of this exercise, we're using the "root" account, as this is just a How-To. Now test SSH via the new keys and you should be in business.Ī quick note pertaining to best practices and security. CHMOD 600 the parent directory on each as well. z This will tell tar that to compress the files. p Preserving files and directory permissions. tar Tape archive c Create v Verbose mode will print all files that are archived. If not create it using the following command: mkdir /backup Tar command explained. Copy the created keys to /root/.ssh/authorized_keys on each server. Simply drag them over across your window or use a simple command line like Copy-Item -Path C:Folder -Destination SERVER2cFolder2. Note: make sure the destination folder exists first. This is accomplished via "ssh -keygen -t dsa". My problem statement is how to auto sync /home/username/script folder to /var/I tried using lsyncd and this is my conf file. To do this, we're going to use SSH.įirst, create an SSH key between both servers so authentication is handled without the need to prompt for credentials upon every change. In order for the active server to make these changes on the passive server, we must establish a one-way trust, allowing the active to mod the passive. The scripting is then used to pass these changes and restart a service on the passive server so it stays in sync. In this example, we're going to have an active/passive configuration where only administrative changes are made on the active server.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |