Neo
Neo

Reputation: 11

Timestamp in file output

I've got a script running, which should output a timestamp in the filename. It works but it's keeping the same date and time.

What am I doing wrong? The script:

#!/bin/bash FOR 192.168.2.20
    
cd Videos/VideoCaptures
counter=0
while :
do  
    echo "\nCount No = " $counter
    currentdate=`date +"%Y-%m-%d-%Hhr-%Mmin-%Ssec"`
    sudo openRTSP -D 1 -c -B 10000000 -b 10000000 -4 -Q -F $currentdate -P 3600 -w 1920 -h 1080 -K -t -u admin 12345 rtsp://admin:[email protected]:554/ch0_0.h264
    counter=$((counter+1))
done
exit

I'm getting this:

File listing

Upvotes: 1

Views: 412

Answers (1)

xhienne
xhienne

Reputation: 6134

Your line echo "\nCount No = " $counter should show you that the openRTSP never terminates. You probably have only one line Count No = 0.

Actually, this is the same openRTSP program that has created all those files, hour after hour (due to the -P option). The name of each file it created is prefixed by the -F option, which contains the date when your started openRTSP.

Upvotes: 1

Related Questions