• Edit
  • Delete

initramfs / busybox cron (Ubuntu 18.04)

Note: full busybox installation is needed:
https://www.ullright.org/ullWiki/show/install-full-busybox-in-initramfs-ubuntu-18-04

  • mkdir -p /var/spool/cron/crontabs
  • crontab -e
    •   SHELL=/bin/bash
        */2 * * * *date >> /date.txt
  • mkdir -p /var/log/
  • busybox crond --help
    • BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) multi-call binary.
      
      Usage: crond -fbS -l N -L LOGFILE -c DIR
      
          -f    Foreground
          -b    Background (default)
          -S    Log to syslog (default)
          -l N    Set log level. Most verbose 0, default 8
          -L FILE    Log to FILE
          -c DIR    Cron dir. Default:/var/spool/cron/crontabs
  • busybox crond -L /var/log/crond.log
  • ps | grep crond
    • 352 root      2320 S    busybox crond --L /var/log/crond.log
  • killall busybox
    • -> cron killed