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!
try redirecting stderr and stdout to filename
diascope -clean /mnt/videos/video$1.txt 1> /var/www/html/video/encodeVideo.log 2>&1
command &> word
glenn jackman 2012-04-05 15:03
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) - SSH This 2012-04-05 15:09
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 >
.