Cron Jobs

Run background processes on a schedule with Cron

Edit a Cron Schedule

I highly recommend using tools like Crontab Guru for generating cron schedules.

How to Start a Cron Job in Linux

Create a basic bash script to run in the background:

command line
nano hello.sh

# echo "hello world!"

realpath hello.sh # get the full path of the file

Start the cron service and edit the crontab file:

command line
sudo service cron start

crontab -e

Edit the crontab file with the path to your bash script:

* * * * * /mnt/d/apps/linux-playground/hello.sh

Verify that the cron job is running:

command line
crontab -l
sudo grep CRON /var/log/syslog
sudo grep CRON /var/log/cron

Questions? Let's chat

Open Discord