I would like to call the script ./archive-it.sh with folder name ( like project1 ) without trailing / and expect to archive it, I am sure its pretty simple, as I am new to bash script i am stuck. Can someone help.
but currently i am getting error here
$target=$(echo "$1"-`date +%m-%d-%Y-%H_%M`)
Here is the script
!/bin/bash
######### archive-it.sh ############
echo "Argument $1";
$target=$(echo "$1"-`date +%m-%d-%Y-%H_%M`)
tar -czvf $target.tar.gz $1
echo "####################################"
echo "ARCHIVE Successfully done at :"
echo "${target}" ;
also suggest me if its good to exclude .git folder, as I am taking only backup on a daily basis.