This is my code to exclude some files,when copy files from one folder to another folder,Copy folder recursively, excluding some folders , I got the idea from this link.
But now the problem is,if I need to exclude only one file,this is working,but for many it's not.(I include all the files,that need to exclude in a text file and give the name of that text file like this,exclude=textfile.txt ,but still it's not working)
cd /source_directory
tar cf - --exclude=dir_to_exclude . | (cd /destination && tar xvf - )