bash - Excluding executable file in Tar -


i'm doing backup of program, , want exclude executable file bin directory.

i'm doing it's not working properly:

newfiles=( "bin" "include" "obj" "src" "makefile" "create_backup.sh")  tar -pczf ../backup_`date +%y-%m-%d_%i-%m-%s`.tar.gz ${newfiles[*]} --exclude='./bin/*' 

this way executable still in bin folder after backup done.

how can properly?

try moving --exclude in front of newfiles in order on commandline, , explcitly naming unwanted file this:

tar -pczf ../backup_`date +%y-%m-%d_%i-%m-%s`.tar.gz --exclude='./bin/unwantedexecutablename' ${newfiles[*]}  

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -