PDA

View Full Version : redirect output boot script



cris_1986
September 13th, 2012, 01:34 AM
hy,
i have a python script. It works.
example:


#!/usr/bin/env python
print "hello world"


i have put this script in the startup applications (system -> preference -> startup application)

i don't know if this script work at the boot. there is a way to redirect the output in a file?

This is my /home/user/.config/autostart/script.desktop file:



[Desktop Entry]
Type=Application
Exec=python /home/user/.scrscript/.script.py &> /home/user/log.txt
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[it_IT]=example
Name=example
Comment[it_IT]=python
Comment=python

iponeverything
September 13th, 2012, 03:15 AM
Exec=python /home/user/.scrscript/.script.py > /home/user/log.txt 2>&1 &

brad103
April 20th, 2013, 09:54 AM
This doesn't work for me (12.04)



[Desktop Entry]
Type=Application
Exec=firefox file:///opt/peace/index.html?datamode=7 > /var/log/peace/firefox.log 2>&1 &
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_NZ]=firefox
Name=firefox
Comment[en_NZ]=
Comment=


ls -l /var/log

...
drwxrwxrwx 2 usr1 usr1 4096 Apr 20 20:27 peace
...

I tried with and without trailing ampersand (which is assumed anyway as it's startup apps are backgrounded tasks)

Any thoughts?

Thanks

brad103
April 29th, 2013, 10:32 AM
Anybody got any thoughts?

schragge
April 29th, 2013, 12:12 PM
Well, firefox writing nothing on standard output when starting up is normal. What are you trying to log?

brad103
April 30th, 2013, 09:26 AM
I use window.dump from firefox and it outputs fine when run directly from a shell. Fair point, but I do expect valid output from firefox in this instance. Thanks

brad103
May 6th, 2013, 10:51 PM
Still unresolved. Any further advice?