Software to sync (track & implement changes in) folders on various media in Ubuntu

Hi, i am using Ubuntu Mate 22.04.2 LTS and it is ok.
I need some app which would sync several main folders with work files on various media.
I.e. I have a main folder with several supplementary folders on one laptop, and would like to have the same folders with the same updated contents on another laptop, as well as on a flash drive.
That is, I may update one file in one folder containing many files or add some new files to the folder or its subfolder and would like all these changes be implemented on a flash drive and on another laptop.

Currently it seems a bit time consuming to track all the updates I make to the folders on one media
and then manually copy paste them onto the same folder structure on another media (flash drive).

I need an app which would compare the 2 folders on different media (laptop and a flash drive) and would automatically update the files in the to-update folder (flash drive) or insert any new added files in the relevant subfolders, that it is track and implement changes on a flash drive, and then
(if I'd like to sync folders from the flash drive into another laptop) to update the folders on another
laptop from the flash drive.

Can you recommend the relevant (open-source) software for Ubuntu?

(potentially I may need to have a similar updated folder structure on a Windows laptop)

1 Like

you describe rsync, very powerful tool with plenty of options, man rsync

Example: I have SRC and DEST ...

rsync -a SRC DEST will copy all files in SRC to DEST
SRC may have 8 files, DEST may have 10 files (old files).

add --delete flag, rsync -a --delete SRC DEST
both SRC and DEST will be the same (8 files).

3 Likes

So far I rarely delete, mainly update .txt or .odt files and adding new files of various formats.
I suppose rsync -a would copy the new files from SRC to DEST and should ask if there is a modified file with identical name whether I'd like to replace it?
And this would work if SRC is a folder with multiple subfolders, it will copy/update the file in the relevant subfolders?

1 Like

rsync does all that.

I backup my mainfolder (and subfolders ) to my NAS1 and NAS2. For NAS1 I have the --delete flag so mainfolder and NAS1 are always the same. diff mainfolder NAS1 shows me all dirs/files are common.

But for NAS2 I don't have the --delete flag so NAS2 will contain other files, folders and eventually grows. If there is a file with same name, rsync will replace on DEST. diff mainfolder NAS2 will show the common and differences.

I suggest make two folders, /home/smith/mainfolder and /home/smith/nas1, throw some files in mainfolder, rsync mainfolder nas1. Modify files in mainfolder, rsync again, see the result.

Do, diff mainfolder nas1

The Web has plenty of examples how to use rsync.

2 Likes

Take a look at FreeFileSync (https://freefilesync.org/). It is a folder comparison and synchronization software that creates and manages backups. Instead of copying every file every time, FreeFileSync determines the differences between a source and a target folder and transfers only the minimum amount of data needed. FreeFileSync is Open Source software, available for Windows, macOS, and Linux. It has a nice GUI, the ability to save jobs for repeated execution and works fine.

3 Likes