Eric Hodel
5/6/2009 9:21:00 PM
On May 6, 2009, at 14:10, Michael Satterwhite wrote:
> I have a short ruby script to periodically change the screen
> background
> under gnome (Ubuntu Linux). Trace statements in the script show that
> the
> script itself is running. The problem is that the system() call is not
> working. Note that I'm running it as myself, not as root. The same
> script works perfectly when run in a console.
>
> Here's the command that isn't working.
>
> ret = system("gconftool -t str --set
> /desktop/gnome/background/picture_filename '#{new_picture}'")
>
> Please accept that the "new_picture" variable has a good value
> pointing
> to a new background. There are traces in the program that write values
> to a trace file that I can examine after the fact. The fact that the
> trace file is updated also shows the script is running.
>
> Does anyone know why this command would work from a console, but not
> from a cron job?
Use full paths in cron and scripts run from cron, as cron has a
limited environment. /path/to/gconftool will fix this.