Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Sync two local directories in a Linux machine

// Install rsync 
sudo apt-get install rsync
// Run this everytime the source directory here: dir1 is changed
rsync -av --progress --delete dir1/ dir2

// for instance:
sudo rsync -av --progress --delete frontend/build/ /var/www/html


// FYI Unison seems to be another popular alternative 
"https://www.cis.upenn.edu/~bcpierce/unison/"
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #Sync #local #directories #Linux #machine
ADD COMMENT
Topic
Name
5+9 =