Skip to content

Instantly share code, notes, and snippets.

@dimitar-grigorov
Last active December 3, 2019 06:47
Show Gist options
  • Save dimitar-grigorov/75153f55f460c42dd320afb148cb6ab7 to your computer and use it in GitHub Desktop.
Save dimitar-grigorov/75153f55f460c42dd320afb148cb6ab7 to your computer and use it in GitHub Desktop.
Antminer cron daemon config

Antminer crontab service configuration.

In Antminer S9 firmware there is crontab executable installed, but it is not configured as a daemon.

Here is how to configure it:

  1. Create daemon config file /etc/init.d/cron with the contents of the cron file at the bottom of the gist.
  2. Make it executable
chmod 755 /etc/init.d/cron
  1. Start cron daemon at boot
ln -s /etc/init.d/cron /etc/rc5.d/S50cron
  1. Start the daemon
/etc/init.d/cron start
  1. Edit tasks with "crontab -e" or vi /etc/crontabs/root
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/crond
NAME=cron
DESC="Crontab"
OPTS="-c /etc/crontabs"
case "$1" in
start)
echo -n "Starting $DESC: "
mkdir -p /etc/crontabs
mkdir -p /var/spool/cron
ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null
start-stop-daemon --start -x "$DAEMON" -- $OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop -x "$DAEMON"
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop -x "$DAEMON"
sleep 1
start-stop-daemon --start -x "$DAEMON" -- $OPTS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment