Skip to content

Instantly share code, notes, and snippets.

@kranthilakum
Created July 19, 2026 07:49
Show Gist options
  • Select an option

  • Save kranthilakum/32c1e0ae4a6e15228700c785f83c4f60 to your computer and use it in GitHub Desktop.

Select an option

Save kranthilakum/32c1e0ae4a6e15228700c785f83c4f60 to your computer and use it in GitHub Desktop.
Crontab - Personal Productivity

Crontab Jobs

πŸ… Break Reminder

* * * * *
| | | | |
| | | | +-- Day of week (0-7, where 0 and 7 = Sunday)
| | | +---- Month
| | +------ Day of month
| +-------- Hour
+---------- Minute

Create an *.sh script file.

~/break-reminder.sh

Add the osascript to the file.

#!/bin/bash
osascript -e 'display notification "⏰ Time to take a break!" with title "πŸ… Break Reminder"'

Modify file access permissions. Make it executable.

chmod +x ~/break-reminder.sh whoami

write in crontab file - crontab -e

# Break reminder every hour from 6 AM to 10 PM
0 10-16 * * * /Users/<username>/bin/break-reminder.sh

list crontab jobs - crontab -l

# Break reminder every hour from 10 AM to 04 PM
0 10-16 * * 1-5 /Users/<username>/break-reminder.sh

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment