Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to sync from this directories list only the web directory. I am using a debian distro and the rsnapshot with rsync protocol for the transfer of the data.

clients
├── client3
│   ├── site1.eu -> /var/www/clients/client3/web12/
│   ├── site2.it -> /var/www/clients/client3/web2/
│   ├── site3.it -> /var/www/clients/client3/web1658/
│   ├── web12
│   │   ├── cgi-bin
│   │   ├── log -> /var/log/panel/httpd/site1.eu
│   │   ├── ssl
│   │   ├── tmp
│   │   └── web  <<<< TO INCLUDE
│   ├── web1658
│   │   ├── cgi-bin
│   │   ├── log -> /var/log/panel/httpd/site2.it
│   │   ├── ssl
│   │   ├── tmp
│   │   └── web   <<<< TO INCLUDE
│   └── web2
│       ├── cgi-bin
│       ├── log -> /var/log/panel/httpd/site3.it
│       ├── ssl
│       ├── tmp
│       └── web   <<<< TO INCLUDE
.
.
.
.

this is what I want:

clients
├── client3
│   ├── site1.eu -> /var/www/clients/client3/web12/
│   ├── site2.it -> /var/www/clients/client3/web2/
│   ├── site3.it -> /var/www/clients/client3/web1658/
│   ├── web12
│   │   └── web
│   ├── web1658
│   │   └── web
│   └── web2
│       └── web
.
.
.
.

This is the rsyncd configuration file in the webserver

# RSYNCD CONFIG FILE

log file =/var/log/rsyncd.log 

[WEBSITES]
   path = /var/www/clients/
   read only = yes
   list = yes
   uid = 0
   gid = 0
   hosts allow = 123.123.123.132
   max connections = 25
   socket options = SO_KEEPALIVE
   include from = /etc/rsyncd.rules

[secure]
   secrets file = /etc/rsyncd.secrets
   list = false

thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Go to your clients directory in the source filesystem. Then you can use the following command

rsync -R -r client3/*/web*/web   target_clients_folder

Make sure you get the correct target and source matching. Else your files may be copied elsewhere.

Essentially you should be using -R -r options with an expression including some * characters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.