0

I can access two computers B and C, but they can access each other's files only by using an external hard drive.

  • I use an external drive to back up computer B's files.

  • Then I connect the external hard drive to computer C and directly edit on the files in the external hard drive.

  • After finishing editing the files on the external hard drive, I would like to sync the contents of the hard drive of computer B from the external hard drive.

  • After disconnecting the external hard drive from computer B, I edit the files on computer B.

  • Then I connect the external hard drive to computer B, and would like to sync the external hard drive from the hard drive of computer B

What are rsync commands used for synchronization between computer B's hard drive and the external hard drive?

Just imagine computer B is at your home, and computer C is in your office. You would like to access and edit the files in B while working on C in your office, and to add the changes back to B when back at home, and then edit the files on B and would like to access the updated files on B while working on C the next day.

Thanks.

1
  • Sounds like you'd be better off only storing the files on the hard drive, or keeping them in a Git repository there and syncing that way instead.
    – Kusalananda
    Jan 23, 2017 at 9:02

1 Answer 1

2

In this case i would use rsync with this option:

rsync -av --delete <src> <dst> >> <dst log.success> 2>> <dst log.error>

The -a option is a combination flag.

It stands for "archive" and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.

It is more commonly used than -r and is usually what you want to use.

The -v flag (for verbose).

The --delete option is necessary to delete files from the destination directory if they are removed from the source. By default, rsync does not delete anything from the destination directory.

That if you want to use rsync, but, I think using cloud storage is the best solution in your case

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .