newbie,cgi,os.system,cdrecord

R

Rik van der Helm

Hello,

I am trying to make a backupscript in python, which I want to manage via a
webform (cgi). In my script I use os.system to execute the following
shellscript:
"cdrecord -s -dev=0,1,0 -blank=fast -speed=2 fs=8m file.tgz"

When I execute the pythonscript in the shell, it gets executed well and I
get some output from cdrecord. Which I don't understand because I put
cdrecord at silent (-s !) I thought.

When I execute the pythonscript in a webbrowser via cgi, cdrecord also gets
executed well but I get an 'Internal Server Error' of Python and in
'/var/log/httpd/error_log' it says:
"malformed header from script. Bad header=Cdrecord 1.11a19 etc....."

I think I understand what is going wrong. Apache tries to print the output
of cdrecord and finds something wrong and stops executing the script. Is
this correct ? If this is correct how do I get cdrecord stop making output
texts ?

All suggestions are welcome

Thanks, Rik
 
J

Josiah Carlson

Hello,

I am trying to make a backupscript in python, which I want to manage via a
webform (cgi). In my script I use os.system to execute the following
shellscript:
"cdrecord -s -dev=0,1,0 -blank=fast -speed=2 fs=8m file.tgz"

When I execute the pythonscript in the shell, it gets executed well and I
get some output from cdrecord. Which I don't understand because I put
cdrecord at silent (-s !) I thought.

When I execute the pythonscript in a webbrowser via cgi, cdrecord also gets
executed well but I get an 'Internal Server Error' of Python and in
'/var/log/httpd/error_log' it says:
"malformed header from script. Bad header=Cdrecord 1.11a19 etc....."

I think I understand what is going wrong. Apache tries to print the output
of cdrecord and finds something wrong and stops executing the script. Is
this correct ? If this is correct how do I get cdrecord stop making output
texts ?

All suggestions are welcome

Thanks, Rik

Try:
"cdrecord -s -dev=0,1,0 -blank=fast -speed=2 fs=8m file.tgz > /dev/null"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,949
Members
47,500
Latest member
ArianneJsb

Latest Threads

Top