A simple yet powerful menu-driven Task Scheduler built using Bash scripting and Linux cron (crontab).
This project allows you to automate, schedule, and manage recurring tasks directly from the terminal without manually editing crontab.
It is designed for beginners learning Linux, Bash, and DevOps automation.
✅ List all scheduled tasks
✅ Add tasks (Hourly / Daily / Weekly)
✅ Remove existing tasks
✅ Interactive CLI menu
✅ Uses Linux cron internally
✅ Lightweight and beginner-friendly
✅ Real-world automation use case
- Bash (Shell Scripting)
- Linux
- Cron (crontab)
linux-task-scheduler-bash/
│
├── task_scheduler.sh → Main scheduler program
├── ben.sh → Example scheduled task
├── task_log.txt → Auto-generated log file
├── README.md
├── SETUP.md
└── .gitignore
sudo apt update
sudo apt install cron -y
sudo service cron startCheck:
crontab -lchmod +x task_scheduler.sh
chmod +x ben.sh./task_scheduler.shMenu:
1 List Tasks
2 Add Task
3 Remove Task
4 Exit
#!/bin/bash
echo "Task executed at $(date)" >> task_log.txtThis script logs the execution time whenever it runs.
* * * * * command
│ │ │ │ │
│ │ │ │ └── Day of week
│ │ │ └──── Month
│ │ └────── Day of month
│ └──────── Hour
└────────── Minute
0 * * * * script.sh → Every hour
0 9 * * * script.sh → Daily 9 AM
0 9 * * 1 script.sh → Weekly Monday
*/5 * * * * script.sh → Every 5 minutes
- User selects an option from the menu
- Script interacts with
crontab - Adds/removes scheduled jobs
- Cron automatically execu