0

Crontab is asked to execute a script every 6 hours 0 */6 * * * /usr/bin/ffmpeg.restart

ffmpeg.restart checks all ffmpeg processes(between 6-8), kills them all and executes /usr/bin/ffmpeg.start

In ffmpeg.start I have the following commands

./ffmpeg -i IP bunch-of-options OUTPUT

./ffmpeg -i IP bunch-of-options OUTPUT

./ffmpeg -i IP bunch-of-options OUTPUT

The problem I have is that when i execute ./ffmpeg.restart from any other directory but /usr/bin it tells me that ./ffmpeg is not found.

I am sure I am missing something here. I even tried "cd /usr/bin" in the ffmpeg.start but still it tells me that it cant find it in the directory. Doing everything manually works fine. Which directory is it looking it?

Andy
  • 583
  • 2
  • 9
  • 23

1 Answers1

0

As devnull says. The problem is with the ./ ... there are several options to work around the problem, including a cd /usr/bin at the beginning of your file, or removing the ./ from the command invocation. The safest is to supply the full path to ffmpeg in the script

/usr/bin/ffmpeg -i IP bunch-of-options OUTPUT
/usr/bin/ffmpeg -i IP bunch-of-options OUTPUT
/usr/bin/ffmpeg -i IP bunch-of-options OUTPUT
tink
  • 14,342
  • 4
  • 46
  • 50