Results 1 to 3 of 3

Thread: aticonfig within crontab

  1. #1
    Join Date
    Jan 2006
    Location
    Brighton, England.
    Beans
    116
    Distro
    Ubuntu Development Release

    aticonfig within crontab

    Hiya,

    I'm trying to read some values from my AMD GPU via aticonfig within a script started via a crontab.

    Its running under the superuser's cron (i.e. "sudo crontab -e)
    Code:
    * * * * * /home/ian/monitor.sh
    (I've also tried :
    Code:
    * * * * * DISPLAY=:0 /home/ian/monitor.sh
    The file its running is a exec, owned by root :
    Code:
    4 -rwxrwxr-x 1 root root 2645 Mar  1 21:22 monitor.sh
    And looks like this :
    Code:
    #!/bin/bash
    # monitor.sh
    
    temp=`DISPLAY=:0 /usr/bin/aticonfig --odgt`
    echo "$temp" >> /tmp/temp
    Every minute I get the following in the output file :
    Code:
    ERROR - X needs to be running to perform AMD Overdrive(TM) commands
    But when I manually run the script, it works fine.
    i.e.. running "sudo ./monitor.sh" appends this to the output file
    Code:
    Default Adapter - AMD Radeon R9 290 Series
                      Sensor 0: Temperature - 80.00 C
    I can't see/find what I'm missing, can anyone help me on this?

    Many thanks in advanced.

  2. #2
    Join Date
    Jul 2013
    Location
    Wisconsin
    Beans
    4,952

    Re: aticonfig within crontab

    I suspect you may be missing another environment variable that your X-based terminal has, but that the cron environment lacks.

  3. #3
    Join Date
    Jan 2006
    Location
    Brighton, England.
    Beans
    116
    Distro
    Ubuntu Development Release

    Re: aticonfig within crontab

    Thanks, I could not for the life of me find out what was missing, I even used my profile from the script!

    But I solved it by using my user crontab and not superuser! :sigh:

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
  •