• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

correct sentinel crontab log string?

europound

Member
is this correct?

* * * * * cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log
 
If /root/dashman/sentinel is where you installed sentinel, then yes, this is correct. You can try running the command manually - if there is no output, then sentinel is working and you have done everything right.
 
I tried

No modification made
root@e4658ba3ec87:~/log# cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py >>/root/log/sentinel-cron.log 2>&1
root@e4658ba3ec87:~/dashman/sentinel# cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py >>/root/log/sentinel-cron.log 2>&1
root@e4658ba3ec87:~/dashman/sentinel# cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py >>/root/log/sentinel-cron.log
root@e4658ba3ec87:~/dashman/sentinel# venv/bin/python bin/sentinel.py
root@e4658ba3ec87:~/dashman/sentinel#


immediately returns back to shell
is this normal?
should not it hang up without returning to prompt?
 
Did you read my message? If you run sentinel and it immediately returns you to shell, then it is working and you have done everything right. This is by design, to avoid filling log files with unnecessary success messages, since sentinel must run once every minute.
 
https://dashpay.atlassian.net/wiki/spaces/DOC/pages/103922706/Sentinel

Sentinel is responsible for monitoring and persisting features unique to Dash, such as superblocks, votes, proposals and other governance objects. It monitors dashd to ensure it is fully synchronised, and synchronises this state with the rest of the network. It is a critical part of Dash since version 12.1, and if you choose not to run it on your masternode, you will not get paid.
 
is this correct?

* * * * * cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log

NO! You have to put the 2>&1 part behind or it will not display error messages in the log!
I learned that with the last sentinel bug...

Code:
* * * * * cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py >> sentinel-cron.log 2>&1
 
if you don't belive, try this:

Code:
md test
rm test
rm test >> test.log
rm test 2>&1 >> test.log
rm test >> test.log 2>&1
rm -rf test
 
NO! You have to put the 2>&1 part behind or it will not display error messages in the log!
I learned that with the last sentinel bug...

Code:
* * * * * cd /root/dashman/sentinel && venv/bin/python bin/sentinel.py >> sentinel-cron.log 2>&1

Yep, that's right. 2>&1 will redirect STDERR to STDOUT when being used like you mentioned. Else, it will only write the output of the command to the file, but not error messages. The order is important.
 
Back
Top