gstatus icon indicating copy to clipboard operation
gstatus copied to clipboard

run gstatus in a crontab

Open darkiop opened this issue 4 years ago • 3 comments

Hi, I would like to use gstatus to generate a json that is delivered via a local webserver. When I start gstatus manually with the -o option, the output as json can be generated.

If I start gstatus in a one line script via crontab, the json can not be generated (file size = 0B).

My proxmox host then sends me the following error by email:

image

/usr/local/bin/gstatus -a -o json > /tmp/test.json

Any Ideas?

Thanks and regards, Thorsten

darkiop avatar Sep 18 '21 10:09 darkiop

Looks like /usr/local/sbin is not available in the PATH when run as crontab. Is Gluster installed in /usr/local/sbin/gluster?

aravindavk avatar Sep 18 '21 12:09 aravindavk

no, its installed in /usr/local/bin/gstatus

to exclude problems with $PATH i had specified the complete path in the crontab:

/usr/local/bin/gstatus -a -o json > /tmp/test.json

darkiop avatar Sep 18 '21 13:09 darkiop

no, its installed in /usr/local/bin/gstatus

to exclude problems with $PATH i had specified the complete path in the crontab:

/usr/local/bin/gstatus -a -o json > /tmp/test.json

I mentioned about path of the gluster binary. Run which gluster to know the path. Or Use below command to run in crontab

PATH=$PATH:/usr/local/sbin /usr/local/bin/gstatus -a -o json > /tmp/test.json

aravindavk avatar Sep 18 '21 15:09 aravindavk