Quantcast
Channel: How to make two directories identical? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4

Answer by nux for How to make two directories identical?

$
0
0

I would suggest to use rysnc command :

rsync (stands for remote synchronization) is an open source tool for data transfers between Unix systems.

rsync synchronizes directories – makes one directory look (contain the same files and subdirectories) exactly like another one. by comparing them as per specified criteria (file size, creation/modification date or checksum) .

How to use rsync :

sudo rsync -az /pathof folder A /pathof folder B

sudo rsync -az /pathof folder B /pathof folder A

-a archive mode (implies recursive, copy symlinks as symlinks, preserve owner, modification times, group, owner, special and device files)

-z compresses the data

I would Suggest also to use watch command which will repeat rsync every interval of time , or use cron .

For more info about watch command : Here

Reference : Here


Viewing all articles
Browse latest Browse all 4

Trending Articles