Linux Rsync Exclude File,Directory and Folder Examples

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-rsync-exclude-filedirectory-folder-examples/
PINTEREST
PINTEREST
INSTAGRAM

Rsync is very popular and powerful tool used for backup and clone operations. Rsync can work in localhost or remote hosts. This makes rsync very flexible. We have all ready provided some introduction in the following tutorial.

Rsync Command Tutorial With Examples

In this tutorial we will look exclude operations in detail. Exclude feature provides a lot of different use cases. We will look most useful of them.

Exclude Specific Directory

One of the most useful use case for exclude feature is excluding given directories. In this example we will exclude directories those names starts with vms .

Exclude Specific Directory

Exclude Specific Directory

Exclude Multiple Directories with Specific Pattern

In previous example we have provided only one directory for exclude. We can also provide multiple directories for exclude. We will use wildcard. We will also use wildcard * to complete vms directory name.

Exclude Specific File

We can exclude specific file by providing its relative path. In this example we will exclude file named file1 .

Exclude Relative Path

Like previous example we will exlude given relative path completely. In this example we will exclude path /home/ismail/Downloads/vms from sync operation.

Exclude Specific File Type

We can also specify the file type or extension we want to exclude from sync operation. We will provide the exclude file name like *.txt which means exclude txt extension files.

LEARN MORE  How To Create Extra Network Bandwidth For Backup?

Exclude Multiple Files and Directories At The Same Time

Up to now we have used only single exclude option. What will be if we want to exclude multiple files or directories. Actually we can use multiple exclude options to exclude multiple files and directories. In this example we will exclude vms directories and *.tmp temp files.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-rsync-exclude-filedirectory-folder-examples/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)