Suppose I waant to rsync only index.html and index.php files. use --include & --exclude? - Tools

This is a discussion on Suppose I waant to rsync only index.html and index.php files. use --include & --exclude? - Tools ; I have a two servers. On the second server I wish to updated only the thousands of index.php and index.html files via rsync from teh first server. I don't want to rsync any other files over--only files with "index" in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Suppose I waant to rsync only index.html and index.php files. use --include & --exclude?

  1. Suppose I waant to rsync only index.html and index.php files. use --include & --exclude?

    I have a two servers. On the second server I wish to updated only the
    thousands of index.php and index.html files via rsync from teh first
    server.

    I don't want to rsync any other files over--only files with "index" in
    their name.

    How can I do this using rsync with --include and --exclude?

    This doesn't work:

    rsync -avz "-e ssh" --include=index --exclude=* /usr/w/var/www
    root@server.com:/usr/w/var

    Thanks!

  2. Re: Suppose I waant to rsync only index.html and index.php files. use --include & --exclude?

    On 17 Dec 2003 16:06:48 -0800, mcgucken@physics.unc.edu (Dr. E) wrote:

    >I have a two servers. On the second server I wish to updated only the
    >thousands of index.php and index.html files via rsync from teh first
    >server.
    >
    >I don't want to rsync any other files over--only files with "index" in
    >their name.
    >
    >How can I do this using rsync with --include and --exclude?
    >
    >This doesn't work:
    >
    >rsync -avz "-e ssh" --include=index --exclude=* /usr/w/var/www
    >root@server.com:/usr/w/var
    >
    >Thanks!


    I've never needed to use include or exclude, I've just used file name
    masking, something more like...

    rsync -avze ssh /usr/w/var/www/index* root@server.com:/usr/w/var


    The second point I'll mention is... Direct root access via ssh is often
    not allowed because it is viewed as a security issue. Setting the html
    content into some user accessable space and restricting roots access via
    ssh are topics worth looking into.


    Brad
    --
    "To live is so startling it leaves little time for anything else"
    Emily Dickinson
    Bradley W. Olin
    http://www.bwo1.com

+ Reply to Thread