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
Post a Comment