How Can I conserve my stream redirection when turning off by power button?

it is my shell scripts.

it turns on whenever I power up my jetson board.
(I have no display monitor on my jetson tk1 board.)

#Linux Script for Executing Python Script.(booting)
echo “Hello World!”

#this one is for reset audio system(it collide with something)
#/etc/init.d/pulseaudio restart
pulseaudio -k
sleep 0.4 # 400 miliseconds
pulseaudio --start
sleep 0.4 # 400 miliseconds

#Determine File’s Name
NOW=$(date +"%Y%m%d%H%M%S")

#Make Text File
python /home/ubuntu/DroneChallenge/ > $NOW.txt

sleep 0.3

exit 0

as you see, result of’s result is saved to $NOW.txt.

I turn off my Jetson Board with my power button.

I followed this instruction.

and when I press Power Button, the console program turned off immediately( I think it is force quit)

and no log file is sustained(I mean… $NOW.txt)

only when I press Ctrl+C to terminate console program, log remains.

how can I sustain my log?

This is a duplicate of: