new step achieved by including a space " ", at the end of the line.
in this line:
http_url =" https://*****.duckdns.org/api/camera_proxy_stream/camera.puerta_esp32cam?token=$1 "
my .sh file now:
#!/bin/bash
exec &>> "/config/shell_scripts/camera_shell_script.log"
echo "token is: $1"
cam_token=$1
folder="/config/www/cam_record"
id=$(date +"%y-%m-%d_%H-%M-%S")cuisine_camera
http_url="https://****.duckdns.org/api/camera_proxy_stream/camera.puerta_esp32cam?token=$1 "
mkdir $folder
ffmpeg -i $http_url -t 1 -vcodec copy $folder/$id.mp4
ls -lh $folder/$id.mp4 $folder/cuisine_camera.mp4
cp $folder/$id.mp4 $folder/cuisine_camera.mp4
ls -lh $folder/$id.mp4 $folder/cuisine_camera.mp4
find $folder -type f -name ‘*.mp4’ -mtime +30 -exec rm {} ;
Now the odd log file (CY4X7X ~ 8) shows this:
token is: 8b*******************************************89f47176ed0
mkdir: can't create directory '/config/www/cam_record
': File exists
ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.0 (Alpine 8.3.0)
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-asm --disable-debug
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mpjpeg, from 'https://**.duckdns.org/api/camera_proxy_stream/camera.puerta_esp32cam?token=8b*********************************76ed0':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 800x600, 25 tbr, 25 tbn, 25 tbc
[NULL @ 0x1268af0] Unable to find a suitable output format for '
'
: Invalid argument
ls: /config/www/cam_record
/20-01-31_17-12-32cuisine_camera
.mp4: No such file or directory
ls: /config/www/cam_record
/cuisine_camera.mp4
: No such file or directory
cp: can't stat '/config/www/cam_record
/20-01-31_17-12-32cuisine_camera
.mp4': No such file or directory
ls: /config/www/cam_record
/20-01-31_17-12-32cuisine_camera
.mp4: No such file or directory
ls: /config/www/cam_record
/cuisine_camera.mp4
: No such file or directory
find: -exec requires an argument
/config/shell_scripts/camara.sh: line 16: $'\r': command not found