team-exor / eiquidus

Feature-rich open-source altcoin block explorer. Regular Updates ~ Platform Independent ~ Mobile Friendly ~ Supports Themes, Markets, Charts, Claiming Addresses, Public API's, Custom RPC Cmds, Bitcoin, Heavycoin, zk-SNARKs ~ List Masternodes, Network Peers, Top 100 Wallets ~ Built-in Update Script ~ Highly Customizable
https://explorer.exor.io
BSD 3-Clause "New" or "Revised" License
87 stars 180 forks source link

Syncings by Cron dont work #44

Closed B1ackt34 closed 6 months ago

B1ackt34 commented 6 months ago

Hi team, i have started an explorer and it works very well but it doesnt sync via cron. Here is my cron text: /1 cd explorer && npm run sync-blocks > /dev/null 2>&1 /5 cd explorer && npm run sync-markets > /dev/null 2>&1 /5 cd explorer && npm run sync-peers > /dev/null 2>&1 /5 cd explorer && npm run sync-masternodes > /dev/null 2>&1

if i go to explorer directory and run "npm run sync-blocks > /dev/null 2>&1" it works. Can you give me any help? Thank you in advance!

joeuhren commented 6 months ago

If you haven't already tried, give the alternate cron syntax a try where you specify full paths. Don't forget to change the paths to the absolute path to your explorer and node directories: image

if i go to explorer directory and run "npm run sync-blocks > /dev/null 2>&1" it works.

Just an fyi, the /dev/null 2>&1 part can be omitted when you run the cmd manually since that will prevent any output from being shown and it is useful to see what is happening if/when running manually. /dev/null 2>&1 is only added to the crontab to prevent from filling up your cron logs.

B1ackt34 commented 6 months ago

I will try that way but ... /path/to/explorer in my case is explorer ... i dont understand /path/to/node ... give me a file name in that directory so i can find it please

B1ackt34 commented 6 months ago

Found the solution on my own :) It was /root/.nvm/versions/node/v20.11.1/bin/node Thank you for help

joeuhren commented 6 months ago

I'm glad you found the answer. For anyone else looking at this in the future with similar problems, you can always use the which node cmd to directly find the node path that your installation is using.

I'm closing this issue as complete. If you still need help with the crontab, feel free to reopen this issue to discuss further.