Network data transfer using scp, rsync and ssh

Figure 993. Network file copy using scp Slide presentation
$ md5sum README.md
64e1d4b7f8fbf99219020b5e931db986  README.md

$ scp README.md root@www.medieninformatik.cloud:/tmp
README.md
                                           
$ ssh root@www.medieninformatik.cloud
Last login: Mon Oct 13 13:58:12 2025 from 141.62.20.174

root@applix:~# md5sum /tmp/README.md 
64e1d4b7f8fbf99219020b5e931db986  /tmp/README.md

Figure 994. Network file copy using rsync and ssh. Slide presentation
$ tree hello
hello/
├── pom.xml
└── src
    └── main
        └── java
            └── start
                └── App.java

$ rsync -av --delete -e ssh hello root@www.medieninformatik.cloud:/tmp
sending incremental file list
hello/
hello/pom.xml
hello/src/
hello/src/main/
hello/src/main/java/
hello/src/main/java/start/
hello/src/main/java/start/App.java

sent 3,115 bytes  received 82 bytes  2,131.33 bytes/sec
total size is 2,769  speedup is 0.87

exercise No. 9

Directory transfer by rsync and ssh

Q:

Prerequisite: This exercise requires rsync to be installed both on your server and client.

  1. Create or use a directory hierarchy of your choice containing some files as well on your local machine.

  2. Follow Figure 994, “Network file copy using rsync and ssh. ” copying your directory hierarchy to your remote server.

  3. Repeat the last command. What do you observe?

  4. Add a new file to your directory hierarchy and remove an existing one. Then re-start your command. What do you observe?

  5. Log in to your remote server. Add a new file to your directory hierarchy copy and remove an existing one. Log out and re-start your command. What do you observe?

  6. Change your local working directory. Modify your rsync command to reverse your direction of transfer i.e. copying the directory hierarchy from your remote server to your local client machine.

A:

The --delete option effectively forces synchronization between your local and your remote directory hierarchy.