#!/bin/sh

#tarname=pram_home_`date +%Y%m%d%H%M`
tarname=pram_home_`date +%Y%m%d`
tarpath=/home/pram/tar/$tarname.tar.gz
exclude_name=/home/pram/tmp/$tarname.exclude

pwd=`pwd`
cd /home/pram
find . \( -name '*.old' -o -name '*.old.*' -o -name '*~' \) -print | cut -c 3- >$exclude_name
ls -d .* | egrep -v '(^\.$|^\.\.$)' >>$exclude_name
cd $pwd

cat >> $exclude_name <<EOF
appl
develop
example
info
jtag
jtag.old
lib/batch
logo
misc
people
tar
tmp
EOF

run="gtar -cvzf $tarpath -C /home/pram --exclude-from=$exclude_name . -C /pchome/pram ./info"

echo $run

$run > /home/pram/tmp/$tarname.log
