Results 1 to 6 of 6
How can i sync two directories (the files in the primary directory might be in use)
Details
i have a directory name DIR-1 on computer-1 and a second directory DIR-2 ...
- 12-18-2009 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 63
howto sync two directories
How can i sync two directories (the files in the primary directory might be in use)
Details
i have a directory name DIR-1 on computer-1 and a second directory DIR-2 of computer-2 mounted on the computer-1 which is mounted on computer-1 as /mount/DIR-2
- 12-18-2009 #2
man rsync
If you mounted the directories just for syncing, then you dont have to do that.
Rsync works over the network
Quick and dirty:
On computer-1
rsync -av -e ssh /DIR-1/* USER@computer-2:/DIR-2/
This requires:
- Your current user on computer-1 has access to DIR-1
- USER on computer-2 has access to DIR-2
- ssh is set up
- rsync is installed on both
Notes:
- the -v (verbose) option might or might not be desireable. It will print each file transmitted
- using ssh is a quick and dirty way, but "raw" rsync -ie with an configured rsyncd- is faster, as there is no encryption
- within rsyncd.conf you can also define users/passwords, etc
- Be carefull, what you rsync and where. Especially with --delete
- 12-18-2009 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 63
Thanks i did it
is it possible that i can run the rsync command after 5 minutes
- 12-18-2009 #4Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
You can use cron to schedule the command. Make sure you are happy that it's workin as you wish, then use crontab -e to edit your cron.
Cron can be quite complicated, it'd be best to read up on it first. Cron.
An example for every five minutes might beCode:.---------------- minute (0 - 59) | .------------- hour (0 - 23) | | .---------- day of month (1 - 31) | | | .------- month (1 - 12) OR jan,feb,mar,apr ... | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat | | | | | * * * * * command to be executed
Code:*/5 * * * * rsync -av -e ssh /DIR-1/* user@computer-2:/DIR-2/
- 12-18-2009 #5Just Joined!
- Join Date
- Mar 2008
- Posts
- 63
Thanks for your help. i have done this successfully
thanks again
- 12-19-2009 #6Just Joined!
- Join Date
- Apr 2005
- Posts
- 1
You can try to use iFolder. Just search in google.
iFolder is a simple and secure storage solution that can increase your productivity by enabling you to back up, access and manage your personal files-from anywhere, at any time. Once you have installed iFolder, you simply save your files locally-as you have always done-and iFolder automatically updates the files on a network server and delivers them to the other machines you use.


Reply With Quote