Skip to content

Graph not working when run in script via cronjob ? #45

Open
@nodecentral

Description

Hi

I have a Lua script that I’m trying to run via crontab below.

# m h  dom mon dow   command
0 8 * * * /usr/bin/lua /home/pi/shared/TS_cabin_graph_watts_12h.lua >/home/pi/shared/watts.log 2>&1
1 8 * * * /usr/bin/lua /home/pi/shared/TS_cabin_graph_temp_12h.lua >/home/pi/shared/temp.log 2>&1 

The whole script does a lot of different things, but here’s the specific os.execute graph request below.

print("Start : graph command")
local x = os.execute('graph /home/pi/shared/feed12hr.csv -y 9,10 --ylabel Temp --title CabinTemp --figsize 1600x1000 --output /home/pi/shared/cabingraph12hr.png') 
print(x)
print("End : graph command") 

When I run it manually at the command line it works fine - see output below.

Start : graph command
/usr/local/lib/python2.7/dist-packages/pandas/plotting/_converter.py:129: FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.

To register the converters:
        >>> from pandas.plotting import register_matplotlib_converters
        >>> register_matplotlib_converters()
  warnings.warn(msg, FutureWarning)
0
End : graph command

but when I check the logs after running it via a cronjob, it fails and reports the following

Part 4
Start : graph command
32512
End : graph command

Any idea of the cause and required fix ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions