In the following example the file src_directory/file.txt will not be transferred: rsync -a -exclude 'file.txt' src_directory/ dst_directory/ Exclude a Specific Directory #Įxcluding a specific directory is same as excluding a file, just pass the relative path to the directory to the -exclude option as shown below: rsync -a -exclude 'dir1' src_directory/ dst_directory/ To exclude a specific file, pass the relative path to the file to the -exclude option. From a file, using the -exclude-from option.From a command line, using the -exclude option.There are two options to specify the files and directories you want to exclude: When excluding files or directories you need to use their relative paths to the source directory. This tells rsync to syncs directories recursively, transfer special and block devices and preserve symbolic links, modification times, group, ownership, and permissions. In the examples below, we will use rsync with the -a, option.
![grsync non regular files grsync non regular files](https://www.opbyte.it/grsync/grsync-1.2.6.png)
You should have a basic knowledge of how rsync works
![grsync non regular files grsync non regular files](https://i.ytimg.com/vi/7iYS9erANqs/maxresdefault.jpg)
Grsync non regular files how to#
In this tutorial, we will show you how to exclude files and directories with rsync. When copying data, you may want to exclude one or more files or directories based on their name or location.
![grsync non regular files grsync non regular files](https://4.bp.blogspot.com/-Y_Z8V8u91CE/UCf7IgRb6fI/AAAAAAAAF88/SciCAR-JtmE/s1600/grsync-1.0.0.png)
With Rsync you can mirror data, create incremental backups and copy files between systems. Rsync is a fast and versatile command line utility that synchronizes files and folders between two locations over a remote shell.