2

I have made a script that uses a program called Diascope, its a video slideshow program.

I am trying to run this command in encodeVideo.sh

echo "Running diascope -clean /mnt/videos/video$1.txt..."
diascope -clean /mnt/videos/video$1.txt > /var/www/html/video/encodeVideo.log
echo "Removing old deploy dir, and making new one..."

And I am running this script from rc.local so that it runs every time I boot the instance.

All I need is to get the output of the "diascope" command, in rc.local I run encodeVideo:

/bin/bash /var/www/html/video/encodeVideo.sh > /var/www/html/video/newlog

and in newlog I can see this

Running diascope -clean /mnt/videos/video7.txt...
Removing old deploy dir, and making new one...

and /var/www/html/video/encodeVideo.log is completely empty! Diascope uses gawk, and btw I can see the output of the processing when I manually run the encodeVideo.sh script. Why can I not capture it in this log?

Is it possible that it's not standard output, so ">" doesn't actually capture it?

Any ideas would be helpful, thanks!

2 Answers 2

2

try redirecting stderr and stdout to filename

diascope -clean /mnt/videos/video$1.txt 1> /var/www/html/video/encodeVideo.log  2>&1
Sign up to request clarification or add additional context in comments.

2 Comments

@glennjackman So this command diascope -clean /mnt/videos/video$1.txt 1> /var/www/html/video/encodeVideo.log 2>&1 would be the same as diascope -clean /mnt/videos/video$1.txt &> /var/www/html/video/encodeVideo.log (in bash)?
@SSHThis, yes -- see section 3.6.4 under gnu.org/software/bash/manual/bashref.html#Redirections
2

Is it possible that it's not standard output, so ">" doesn't actually capture it?

Absolutely: it could be standard error, in which case you'd have to use 2> instead of >.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.