Run a script through the distribution's daily-job mechanism without specifying an individual time.
Which directory is appropriate?
/etc/cron.daily/ is the conventional directory for daily maintenance scripts. The system decides the exact execution time.
Detailed explanation
/etc/cron.hourly/Incorrect. cron.hourly is for hourly jobs.
Incorrect. cron.hourly is for hourly jobs.
/etc/cron.weekly/Incorrect. cron.weekly is for weekly jobs.
Incorrect. cron.weekly is for weekly jobs.
/etc/cron.monthly/Incorrect. cron.monthly is for monthly jobs.
Incorrect. cron.monthly is for monthly jobs.
/etc/cron.daily/Correct. cron.daily is the daily-job directory.
Correct. cron.daily is the daily-job directory.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' /etc/cron.hourly/ /etc/cron.daily/ /etc/cron.weekly/ /etc/cron.monthly/Expected result
周期別ディレクトリ名の一覧Key points
- daily means once per day
- The time is configured elsewhere
- Check executable and naming rules
Notes
- Environment: printf / ファイルシステム変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.