Synchronizing Two Folders Print

  • 0

The following commands can be used to synchronize the changes from one folder into another.

Method A - Copy (CP) Command

cp -ruvf source_folder/ destination_folder/

In the above:
-r indicates recursive
-u indicates to copy if file is newer or does not exist
-v indicates to print verbose the activity being performed
-f indicates to force the overwrite of existing files

Method B - Remote Synch (RSYNC) Command

rsync -rtvu source_folder/ destination_folder/

In the above:
-r indicates recursive
-t indicates to preserve the modification time
-v indicates to print verbose the activity being performed
-u indicates to copy if file is newer or does not exist


Was this answer helpful?

« Back