CronJob – XMRig Crypto Mining

Running crypto mining requires a huge amount of time and computational power. That is to say electricity. But as long the electricity price is greater than the mining profit, it is pointless. However, some electricity providers have a contract that allows for a dynamic price range based on the electric market.

Commonly, during the night hours, the price is the lowest, as a conquest of fewer people awake to use electricity. In addition, some electricity sources cannot turn off operation, as easily as others, like nuclear plants. Thus the power has to be used.

We can make use of the cheaper electricity price by using cronjob and timeout in Linux. Where the cronjob will schedule when to run the crypto mining program the timeout and how long it will run the program.

Cron

Cron is a scheduling service that is installed on most Linux systems that allows for scheduling. The format can be calculated online, since its format can be a bit hard to remember.

Cronjob can easily be configured by using the following command.

crontab -e 

The following will start xmrig, running for 28800 seconds, or 8 hours, and it will be invoked every day at 11 PM. Adjust the parameter and program your need.

# m h  dom mon dow   command
0 23 * * * /usr/bin/timeout --signal=SIGINT 28800 xmrig -o gulf.moneroocean.stream:10128 -u your_wallet -p node_name