I wrote and use script to this.
This script synchronizes one directory with another.
E.g.: if you have directory "master" with these files:
and if you want to synchronize it with "slave" directory,
you may type this command:
./xqx_usync.sh master slave
After execution of this command, "slave" directory will contain all files from "master":
At first thought, this action looks like copy, but if files in the "master" directory is changed, then after execution of this command again, all data in "slave" will be replaced with new data from "master" directory. Also, if you add new file to the "master" directory, it will be copied into "slave". This script wraps "rsync" command, that fast and high-performance.
#This script synchronizes <master> and <slave> directories.
echo -n Syncing $SLAVE with $MASTER...
if test -z "$MASTER" -o ! -e "$MASTER"; then
echo "Usage: usync <master directory> <slave directory>"
if test -z "$SLAVE"; then
rsync --archive $MASTER $SLAVE
This script is created with Ubuntu Linux.