I Want to move ZIP into current date folder

[Closed]
Report
-
Posts
40805
Registration date
Wednesday August 27, 2003
Status
Moderator
Last seen
August 10, 2020
-
Hello,

I would like to copy or move my zip file into the current dated folder in same run.

I have these code with me.


echo ""
echo "Enter OUTPUT_ZIP (eg. dft, dft1, dft2,...ban01, ban02, ban03)"
read op_name
echo ""
mkdir Sent/`date +%d-%m-%Y`
tar -cf tab_$op_name.tar tab_*
...................................................Now here i want to move my ZIP into current dated folder which created above in this same script.


Please suggest!
Thanks in advance.
Hiten.

1 reply

Posts
40805
Registration date
Wednesday August 27, 2003
Status
Moderator
Last seen
August 10, 2020
17
Hi,
DATE=`date +%d-%m-%Y`
echo ""
echo "Enter OUTPUT_ZIP (eg. dft, dft1, dft2,...ban01, ban02, ban03)"
read op_name
echo ""
mkdir -p Sent/${DATE}
tar -cf tab_${op_name}.tar tab_*  && mv   tab_${op_name}.tar   Sent/${DATE}/