The contents of the Rsync copy directory, but not the directory itself

I am trying to sync two contents of folders with a different name:

rsync -av ~/foo user@remote.com:/var/www/bar 

I would like to copy the contents of foo to bar on the remote host, but not to the foo directory. I tried something like foo/* , but rsync does not support this.

rsync always creates

 /var/www/bar/foo 
+60
rsync
Nov 30 '13 at 13:46
source share
2 answers

Try rsync -av ~/foo/ user@remote.com:/var/www/bar/

+99
Nov 30 '13 at 13:58
source share

Not only rsync, but when you are looking for examples of how to use the GNU / Linux command, you can use "eg", which displays explicit examples. for example, available here, with instructions for installing it: https://github.com/srsudar/eg

The result for eg rsync as follows:

 # rsync copy the folder source_dir and its content into destination_dir rsync -av source_dir destination_dir copy the contents of source_dir (trailing slash) into destination_dir rsync -av source_dir/ destination_dir 
+8
Dec 28 '16 at 15:28
source share



All Articles