



Knowing some basic tools and concepts for file deletion comes in handy and can save you time. To exclude directory with particluar pattern : tar -cvf backup.tar -exclude="log" -exclude="cache" public_heml/ To exclude files with patterns containing preceding and trailing characters : tar -cvf backup.tar -exclude="*.One of the basic file system administration tasks involves creating, modifying, and deleting different types of files and directories. So here we see how to exclude particular pattern. Sometimes we might find multiple pattern in different folders and we would not be interested only on that pattern. Method 1 : tar -cvf backup.tar -X exclude_directory.txt public_html/ Method 2 : tar -cvf backup.tar -exclude-from=exclude_directory.txt public_html/Įxclude_directory.txt Contains : public_html/template/cache List all the directories to be excluded into a file and use this list to exclude directories during tar. To exclude multiple directories you can either provide directories separately or by listing each directory seperated by comma and encased in public_html/ 3. Bad Practice : tar -cvf backup.tar -exclude="public_html/template/cache/" public_html/ Good Practice : tar -cvf backup.tar -exclude="public_html/template/cache" public_html/ 2. So requesting you to not to waste time and follow the good procedure to get the work done soon. I have wasted much time in exploring this. Note: When excluding directories, make sure NOT to use the trailing slash(/) at the end of the directory name. Backup doesn’t mean all the files and folders need to be backed up ! Sometimes we may have to exclude directories like template cache, log files, cache, temporarily created files, gallery directory etc., So in this article, we will see how to exclude certain directories and certain patterns even ! 1. Being myself an administrator, i would recommended “tar”, the simple and the best tool. In day-to-day activities administrators needs to perform regular backups on their Linux servers. : Failed to contact the endpoint at for discovery.: Code 400, message Client must support ‘binary’ or ‘base64’ protocol.: Yum install python-pip | No package python-pip available.How to manually install higher version of PIP for Python v2.7.Too many connections for neutron-db-manage.How to configure Open vSwitch bridge for OpenStack.How to automatically extend windows virtual disk size.To exclude files with patterns containing preceding and trailing characters :.To exclude directory with particluar pattern :.
