How to exclude a folder from rsync

Marian Rick

I am using rsync to deploy a git branch with my production server. Currently, I got js files stored in two locations:

  • assets/js/
  • js/

When I run rsync using --exclude js, non of the both folders will be sync, while I want the assets/js/ folder to be synced and the js/ folder inside my root folder to be skipped. How can I achieve this?

Christopher Díaz Riveros

You need to specify the pattern for those files and directories:

using:

CWRULE [PATTERN_OR_FILENAME]
CWRULE,MODIFIERS [PATTERN_OR_FILENAME]

so you would have something like

CW- js/

For even more detailed info you can see the man page at the section

Include/Exclude Pattern Rules

from this link, hope it helps

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to exclude a folder from rsync

From Dev

How to exclude a folder from rsync

From Dev

How to exclude .cpan folder from rsync?

From Dev

rsync exclude a single file from the root folder

From Dev

How to use rsync command exclude multiple folder

From Dev

How to exclude subdirectory from rsync?

From Dev

Excluding a folder from the home directory with rsync exclude list

From Dev

Prevent Rsync from changing ownership of the folder of the exclude list

From Dev

how do I exclude a specific folder on the destination when using rsync?

From Dev

Rsync exclude from root

From Dev

rsync exclude folder contents but still create folder

From Dev

How to exclude files in rsync?

From Dev

How to exclude files in rsync?

From Dev

How to exclude a file/folder from Build in MonoDevelop

From Dev

How to exclude a folder from YUI compressor

From Dev

How to exclude a folder from a string search

From Dev

How to exclude folder from "Explore" tab?

From Dev

How to exclude a hidden folder from being deleted

From Dev

How can I exclude .* directories from rsync but include the .vnc directory?

From Dev

Include folder with same name that other in exclude in rsync

From Dev

rsync --exclude and --exclude-from not working

From Dev

In grunt , how to exclude .git folder from clean in dist folder

From Dev

In grunt , how to exclude .git folder from clean in dist folder

From Dev

How to rsync the / folder properly?

From Dev

How to properly rsync / folder?

From Dev

How to exclude numeric directories with rsync?

From Dev

How to exclude multiple directories with rsync?

From Dev

How to exclude multiple directories with rsync?

From Dev

How to exclude numeric directories with rsync?

Related Related

HotTag

Archive