I am writing a short script. One functionality is synchronizing two folders. Now I have two variables with directories to two different folder: DIRECTORY_1 and DIRECTORY_2. In both folders are files and other folders. I need to synchronize these folder to have all files in both folders. For example:
- In
DIRECTORY_1I have file1, file2, file3 and folder1 In
DIRECTORY_2I have file4, file5, file6 and folder2I need comment after which I will have in both directories files1-6 and folders1-2.
I was trying rsync command but it doesn't work properly.