What command can check that a directory contains the same files as another directory, all the files are up to date and copy any updated files or new files to the first directory. It should not care about file permissions copying restricted files without checking back.
You can use
rsync for that.
NAME rsync - a fast, versatile, remote (and local) file-copying tool
rsync -av "/path/to/source" "/path/to/destination"
"/path/to/source" is the path of source directory and
"/path/to/destination" is the path to directory which contains destination directory. For example of you want to make synchronization between
/media/users/disk1/dir (as source) and
/media/disk2/dir (as destination), then you should run
rsync -av "/media/users/disk1/dir" "/media/disk2/"
If you want to delete extraneous files from destination, you can use
--deleteoption as follows:
rsync -av --delete "/path/to/source" "/path/to/destination"
If you want to show the progress during transfer then use
rsync -avh --progress --delete "/path/to/source" "/path/to/destination"
There is also
--info=progress2available for outputs statistics based on the whole transfer.
You can also use Lsyncd.It will monitor continuously your mentioned directory tree and when changes happened it will automatically apply the changes.
It is actually similar to Rsync. You can use it for remote sync with SSH+Rsync. The hyperlink is its help page and it can give you more information.
Answer for your question:
lsyncd -rsync /path/directory1 /path/directory2