I am writing a command in the crontab file
длинная команда $(date +%Y%m%d%H%M%S) продолжение When cron starts execution, it sees only this part.
длинная команда $(date + all that after + he does not see.
How can this be overcome?
according to the documentation ( $ man 5 crontab or online ), the percent symbol % will be converted by cron into a newline character.
in order to avoid this, add a backsight character in front of each % symbol used:
... $(date +\%Y\%m\%d\%H\%M\%S) ... /usr/bin/vlc -vvv rtsp://111.222.333.444:554/h264/ch01/main/av_stream --sout=file/ts:/home/admin/web/site.com/public_html/source/recording-$() - Diefairdate ) and the first argument ( +что-то-там ). probably because the result of the command execution ( $(...) ) doesn’t : there is no such program date+что-то-там - aleksandr barakinпрограмма параметр , but a программа параметр . not date+\%Y... , but date +\%Y... - aleksandr barakinSource: https://ru.stackoverflow.com/questions/670303/
All Articles