Random Delay Cronjob Execution

Search for a command to run...

No comments yet. Be the first to comment.
Most AI agents that support scheduled tasks have two sources of instruction when a cron job fires: The cron prompt — the task-specific instructions you wrote when scheduling the job The skill — a re

TL;DR Scarp draw result, host on GitHub, retrieve it like API at damacai.hongineer.com. Data Scraping I have previously shared a technique for scraping Da Ma Cai draw result. Now I finally have time t

This is a Bash script that check if the replica (slave) health status. If there is an issue, it will exist with non-zero status. This is useful when used with monitoring tools like [Monit](https://mmo

chmod is a command-line utility used to change the access permissions of file system objects such as files and directories. It allows you to control who can read, write, and execute those objects. Changing Permissions Using Octal Notation Example Usa...
chown changes the ownership of files and directories. This involves modifying the user and/or group associated with a file, determining who has access and permissions. Changing File Ownership to a Specific User Example Usage: chown user file.txt What...
Sometime there are many jobs to be executed at the same time (e.g. 12 AM daily), and it posed heavy load on the host. If the jobs are not time-sensitive, random-time delay can be introduced to mitigate such issue.
0 0 * * * sleep $((RANDOM % 3600)); /the/execution/script.sh
RANDOM is a bash built-in variable that generates a random integer. RANDOM % 3600 generates a random integer between 0 and 3600 (exclusive). 3600 seconds is equivalent to 1 hour, you can adjust this number to suit your need. The sleep command creates delay in the specified number of seconds.