rsync
installation
normally apt-get install rsync will take care of all parameters for you, but in case you have a disabled installation (like the one in turnkey linux (redmine)) you can do this :
edit the file /etc/defaults/rsync and alter the ENABLE line to :
| /etc/defaults/rsync | |
|---|---|
to be sure enable the startup scripts with :
| enable | |
|---|---|
it will tell you if it was needed or not.
When you start rsync
| start | |
|---|---|
It will probably complain about /etc/rsyncd.conf so :
rsyncd.conf
You will need this file, so start out with the example one.
| conf file | |
|---|---|
Now edit it to your needs, for instance add a new share :
Restart rsync
| restart | |
|---|---|
You can view the status from any rsync host with :
| server status | |
|---|---|
You will get something like :
usage
rsync can just be used as scp with some extra's for instance you can use it to resume a copy operation.
rsync without destination parameter just lists the source and without protocol uses ssh so :
| list source | |
|---|---|
will list the home directories if of course you have the rights.
| copy remote to . | |
|---|---|
will attempt to copy the complete home directory of kees to the current directory. but if you stop that half way and do it again it will start all over, like scp would. using -a, it will resume where it left, also see -v for some progress information.
| resumes when interrupted | |
|---|---|
Finally, to really sync and also delete the files that where deleted on the other side, you use the --delete flag. Caution is advised here, since delete is a very fast operation and could wipe a lot of files if you make a small typo. (one slash will do the trick). So just run a normal sync, see what happens and then add the delete flag:
Also, if you think timestamps are off, you can do it without checking times, and only use sizes with the --checksum parameter:
| checksum | |
|---|---|
However, it seems not do copy much but still take a lot of time deciding not to copy. A comparison with using compression gave :
using a different port
If you are using the
| different port | |
|---|---|
size only
The default algorithm takes into account time stamp and size to decide whether to copy a file or not, if you don't trust the time stamps you can also do size only . For instance copying the mp3 tagged dir to a second location :
This will only copy the newly added mp3's to the directory on servert.