Results 1 to 3 of 3

Thread: Help with crontab

  1. #1
    Join Date
    Jul 2010
    Beans
    25

    Help with crontab

    I'm trying to run
    Code:
    xbacklight -get > test.txt
    every minute, but every way of doing this as a cron job doesn't seem to work. I've tried putting it into a script, setting the path variable in the cron file and the script, setting the shell variable, calling xbacklight with its absolute path, and nothing seems to work. In every case the cron job will write a file, but with nothing inside. Any ideas?

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Help with crontab

    Are you setting the DISPLAY environment variable in your cron command / script? otherwise xbacklight will produce just an error (which will go to stderr not stdout, so won't be captured in your file)

    Code:
    $ echo $DISPLAY
    :0.0
    $ 
    $ xbacklight -get
    100.000000
    $ 
    $ DISPLAY= xbacklight -get
    Cannot open display ""

  3. #3
    Join Date
    Jul 2010
    Beans
    25

    Re: Help with crontab

    It worked! Thanks!

    My new crontab line is:
    Code:
    * * * * * export DISPLAY=:0 && /usr/bin/xbacklight -get > test.txt

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
  •