Place an executable script in the standard directory processed daily by run-parts.
Which location is representative?
/etc/cron.daily contains daily scripts; the actual time is determined by the surrounding cron or anacron configuration.
Detailed explanation
/etc/cron.hourly/Incorrect. /etc/cron.hourly is for hourly jobs.
Incorrect. /etc/cron.hourly is for hourly jobs.
/etc/cron.weekly/Incorrect. /etc/cron.weekly is for weekly jobs.
Incorrect. /etc/cron.weekly is for weekly jobs.
/var/spool/cron/Incorrect. /var/spool/cron stores user crontabs.
Incorrect. /var/spool/cron stores user crontabs.
/etc/cron.daily/Correct. /etc/cron.daily is the conventional daily-script directory.
Correct. /etc/cron.daily is the conventional daily-script directory.
Try it yourself
An example you can run in a temporary verification environment.
test -d /etc/cron.daily && printf '%s\n' /etc/cron.dailyExpected result
/etc/cron.daily(存在する環境)Key points
- daily means once per day
- No five time fields in the file
- Schedule is configured elsewhere
Notes
- Environment: Linux / ディレクトリ存在確認のみ
- 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.