Create a cron job
Green highlight

Set up a cron job on a computer or Raspberry Pi to run a simple script that displays a reminder message every day.

Orange shooting star
Download Guide
Collect Badge
grey blob
Challenge Image
Table of contents

Step-by-step guide to set up a cron job to display a daily reminder

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Scheduling Tasks in Node.js | Cron Jobs in Real Projects

What you need
Adult supervision required, terminal access, text editor or terminal editor (like nano)

Step 1

Open the terminal app on your computer or Raspberry Pi so you can type commands.

Step 2

Create a new script file by typing nano ~/daily_reminder.sh and pressing Enter.

Step 3

Inside the editor type these exact lines then save and exit: #!/bin/bash then notify-send "Reminder" "Time to water the plants!" then echo "$(date): Time to water the plants!" >> $HOME/reminder_log.txt

Step 4

Make the script able to run by typing chmod +x ~/daily_reminder.sh and pressing Enter.

Step 5

Test the script by running ~/daily_reminder.sh in the terminal and watching for a popup or a new line added to reminder_log.txt.

Step 6

If you did not see a popup ask an adult to help install the popup tool by running sudo apt-get update then sudo apt-get install -y libnotify-bin.

Step 7

Open your crontab editor by typing crontab -e and pressing Enter.

Step 8

Add this one line to the crontab then save and exit, replacing yourusername with your account name: 0 9 * * * DISPLAY=:0 XAUTHORITY=/home/yourusername/.Xauthority /home/yourusername/daily_reminder.sh >> /home/yourusername/cron_debug.log 2>&1

Step 9

Share a photo or description of your working reminder on DIY.org so everyone can see your cool cron job creation.

Final steps

You're almost there! Complete all the steps, bring your creation to life, post it, and conquer the challenge!

Complete & Share
Challenge badge placeholder

Help!?

What can I use instead of notify-send or libnotify-bin if they are not available?

If notify-send or libnotify-bin isn't available you can replace the notify-send line in ~/daily_reminder.sh with a zenity --info command or rely on the echo line that writes to $HOME/reminder_log.txt so the cron job still logs reminders.

My cron job didn't show a popup—what should I check to fix it?

If you didn't see a popup or a new line, first run ~/daily_reminder.sh manually to confirm the script works, ensure you ran chmod +x ~/daily_reminder.sh, verify you replaced yourusername in the crontab line and included DISPLAY=:0 and XAUTHORITY=/home/yourusername/.Xauthority, then inspect /home/yourusername/cron_debug.log for errors.

How can this activity be modified for younger or older kids?

For younger kids have an adult create the file nano ~/daily_reminder.sh and add the crontab line while the child tests ~/daily_reminder.sh and takes a photo to share, and for older kids let them edit the notify-send message, change the crontab schedule, or add extra echo lines to $HOME/reminder_log.txt.

How can we extend or personalize the reminder script or cron schedule?

To personalize it, edit ~/daily_reminder.sh to include multiple notify-send messages, a zenity checklist, or sound playback, change the time fields in your crontab entry to run at different times, and keep watching /home/yourusername/cron_debug.log and $HOME/reminder_log.txt for results.

Watch videos on how to set up a cron job to display a daily reminder

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Linux Crash Course - Scheduling Tasks with Cron

4 Videos

Facts about cron and task scheduling for kids

⚡ Cron jobs only run while the computer is powered on — a always-on Raspberry Pi can remind you every day reliably.

⏰ Cron is like an alarm clock for your computer — it automatically runs tasks at the times you schedule.

💡 A shell script is just a plain text file with commands — write it once and run many reminders with a click.

🔁 Cron schedules use five fields (minute, hour, day, month, weekday) so you can run jobs every minute, daily, or only on certain days.

🐧 The Raspberry Pi is a tiny, affordable computer popular with makers and learners for projects and coding.

How do you set up a cron job to display a daily reminder message?

Create a small script (shell or Python) that shows a message (for GUI use notify-send, or echo to a file). Make it executable (chmod +x ~/reminder.sh). Open the crontab with crontab -e and add a line like 0 9 * * * /home/pi/reminder.sh to run at 9:00 daily. If using GUI notifications, set DISPLAY=:0 and XAUTHORITY if needed (e.g., DISPLAY=:0 /usr/bin/notify-send "Reminder" "Do homework"). Test the script manually first.

What materials do I need to create this cron job?

You need a computer or Raspberry Pi running Linux, a user account with terminal access, a text editor (nano, vim, or GUI editor), basic script knowledge (Bash or Python), and permission to edit crontab. For desktop notifications, install notify-send (libnotify). Optionally, have internet for troubleshooting and an adult to help with system permissions if children are learning. A monitor, keyboard, and mouse complete the setup.

What ages is this activity suitable for?

Setting up a cron job is suitable for children around 10+ who have basic typing and reading skills; younger kids (6–9) can participate with guided steps and adult supervision. It teaches sequencing, cause-and-effect, and simple coding. Always supervise when using system commands, and let older children do more of the typing while explaining safety and backups. Adapt complexity to the child’s confidence and prior computer experience.

What are safety tips and fun variations for this cron job activity?

Safety: avoid running unknown scripts, don’t change system files, and test scripts manually before scheduling. Keep backups and use a kid account with limited permissions. Variations: schedule different reminder messages, play a sound, log reminders to a file, trigger a Python GUI popup, or send an email. Benefits include learning automation, time management, and basic scripting. Make it a project by letting kids design the messages and schedule.

Get 7 days of DIY for FREE!

Create a cron job. Activities for Kids.