xmrig-bash-scripts/crontab.sh

23 lines
574 B
Bash
Raw Permalink Normal View History

#!/bin/bash
2019-08-11 16:58:07 +03:00
echo "${_GREEN}CRONTAB STARTED${_RESET}"
# Set values in settings script
# Remove existing crontab
crontab -l > crontab
crontab -r
# Setup users contab
2019-08-05 22:49:49 +03:00
2019-09-04 23:45:50 +03:00
crontab -l | { cat; echo "#Start at $_USER_CRONSTART on days $_USER_CRONDAYS
2019-08-05 22:49:49 +03:00
0 $_USER_CRONSTART * * $_USER_CRONDAYS screen -dmS $_XMRIG_SCREEN xmrig --config=$_XMRIG_CONFIG_LOCATION"; } | crontab -
crontab -l | { cat; echo "#Stop at $_USER_TIMESTOP on days $_USER_CRONDAYS
2019-08-05 22:49:49 +03:00
0 $_USER_CRONSTOP * * $_USER_CRONDAYS screen -S $_XMRIG_SCREEN -X kill"; } | crontab -
2019-08-11 16:58:07 +03:00
echo "${_CYAN}CRONTAB STOPPED${_RESET}"