Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run gstatus in a crontab #61

Open
darkiop opened this issue Sep 18, 2021 · 3 comments
Open

run gstatus in a crontab #61

darkiop opened this issue Sep 18, 2021 · 3 comments

Comments

@darkiop
Copy link

darkiop commented Sep 18, 2021

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 darkiop changed the title gstatus in a crontag gstatus in a crontab Sep 18, 2021
@darkiop darkiop changed the title gstatus in a crontab run gstatus in a crontab Sep 18, 2021
@aravindavk
Copy link
Member

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

@darkiop
Copy link
Author

darkiop commented Sep 18, 2021

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

@aravindavk
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants