I've been using rsync to backup my "main" hdd quite successfully with the following command
rsync -aivr --delete --progress /src/my-files/ /dest/my-files
But I carry my external drive on the go and I might modify files on it. The above command would wipe out those changes. I can't just swap src and dest either because I may have changes on both drive that I want to preserve.
The behavior I want is something like this...
# rsync walks the src drive
# if a file is present in src that is not present in dest, then copy the file to dest
# if a file is present both in src and in dest, then compare modification times
# and overwrite using the later one.
# if a file is present on dest but is not on src, then copy the file from dest to src.
Could I use rsync to get the above behavior?
unison
for 2-way file sync. Here's a link to an article that may help – Seamus May 22 '19 at 22:00