Results 1 to 7 of 7

Thread: redirect output boot script

  1. #1
    Join Date
    Sep 2011
    Beans
    35

    redirect output boot script

    hy,
    i have a python script. It works.
    example:
    Code:
    #!/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:

    Code:
    [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

  2. #2
    Join Date
    Aug 2008
    Location
    WA
    Beans
    2,186
    Distro
    Ubuntu

    Re: redirect output boot script

    Code:
    Exec=python /home/user/.scrscript/.script.py > /home/user/log.txt 2>&1 &

  3. #3
    Join Date
    Jun 2006
    Beans
    29
    Distro
    Xubuntu 8.04 Hardy Heron

    Re: redirect output boot script

    This doesn't work for me (12.04)


    Code:
    [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=
    Code:
    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

  4. #4
    Join Date
    Jun 2006
    Beans
    29
    Distro
    Xubuntu 8.04 Hardy Heron

    Re: redirect output boot script

    Anybody got any thoughts?

  5. #5
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: redirect output boot script

    Well, firefox writing nothing on standard output when starting up is normal. What are you trying to log?

  6. #6
    Join Date
    Jun 2006
    Beans
    29
    Distro
    Xubuntu 8.04 Hardy Heron

    Re: redirect output boot script

    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

  7. #7
    Join Date
    Jun 2006
    Beans
    29
    Distro
    Xubuntu 8.04 Hardy Heron

    Re: redirect output boot script

    Still unresolved. Any further advice?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •