Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

How to Tar excluding few sub directories

$
0
0
Many of us would have perform tar of directories for cloning/file movement between the servers.  Many times we would have think to exclude some sub-directories which are not needed, so that tar will save some time.
Here you go handy commands to achieve your needs.

Let’s say if you want to tar /u10/groups folder and want to exclude few sub directories under groups.

Cd /u10
user@/u10 > tar -cpvzf /tmp/groups.tar.gz groups --exclude-from=excl
user@/u10 > cat excl
groups/group-2/instance-1/core.119006
groups/group-2/instance-1/core.71016
groups/group-2/instance-1/core.75416
groups/group-2/instance-1/trace
groups/group-2/instance-1/conf/opsdb.d
groups/group-2/instance-1/conf/opsdb.d_bkup
groups/group-2/instance-1/conf/opsdb.d_bkup1

Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>