Cronjob

  1. Check if cron service is running:
    ps -el | grep cron
    # It should return a line with cron. Otherwise, Cron service is not running.
     
    # or
    #ls -lut /etc/init.d/cron
    # It shows the last time /etc/init.d/cron was executed or read.
  2. If Cron service is not running on Debian, you have to run the following command:
    /etc/init.d/cron start
  3. To make sure that the Cron service is still running after the reboot, run the following command:
    update-rc.d cron defaults
  4. Test to see if cron is running:
    echo "* * * * * echo 'test'>> /test_cron.txt " > cron_list.txt
    crontab cron_list.txt
    It should append 'test' to /test_cron.txt every minutes.
  5. To remove the cron test, run:
    crontab -r