Tuesday, November 13, 2007

script - create package

Today I write a shell script that is used to create project package, so I can backup easily. There are two features I want the script supports, one is have a date stamp automatically generated, second in the source code directory I want to filter only c source code, for instance just have c and h file.

Here is the script:

export PROJECT_NAME=foo
export PROJECT_PATH=/devel/project
export DATESTAMP=`date +%d%b%Y`

tar czf $PROJECT_NAME-$DATESTAMP.tar.gz ./Makefile.arm-linux ./plugin/*.[ch] ./application/*.c

echo "DONE!"