Generate cron expressions for common scheduling patterns like daily, weekly, or hourly.
Code
Utilitiescase "$schedule" in
hourly) echo "$minute * * * *" ;;
daily) echo "$minute $hour * * *" ;;
weekly) echo "$minute $hour * * 0" ;;
monthly) echo "$minute $hour 1 * *" ;;
weekdays) echo "$minute $hour * * 1-5" ;;
*) echo "Unknown schedule: $schedule" ;;
esacParameters
Schedule type: hourly, daily, weekly, monthly, weekdays.
Hour to run (0-23).
Minute to run (0-59).
Server
More Bash Snippets
Explain Cron Expression
Break down a cron expression into human-readable field descriptions.
Validate Cron Expression
Check if a cron expression has valid format with 5 fields.
Array Difference
Find elements in the first array that are not present in the second array.
Array Frequencies
Count how many times each value appears in an array and return a frequency map.
Array Head
Get the first n elements of an array.
Array Intersection
Find common elements that exist in both arrays.