From Fedora Project Wiki
m (moved User:Mmaslano/crontabs to QA:Testcase crontabs: move into category) |
(Add pkg name -based category) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
|description=run-parts is able to run scripts in a directory. The command run-parts is most often used for cron.daily jobs. | |description=run-parts is able to run scripts in a directory. The command run-parts is most often used for cron.daily jobs. | ||
|setup= | |setup= | ||
|actions=As root try to execute run-parts with(out) options. Pay attention to directory, which you'll run. For example prelink in /etc/cron.daily runs quite long. You might need create your own directory with test files. | |actions=As root try to execute run-parts with(out) options. Pay attention to directory, which you'll run. For example {{command|prelink}} in {{filename|/etc/cron.daily}} runs quite long. You might need create your own directory with test files. | ||
# Execute: | # Execute: {{command|run-parts --test /etc/cron.daily}} | ||
# Execute: | # Execute: {{command|run-parts --list /etc/cron.daily}} | ||
# Run command | # Run the command {{command|tail -f /var/log/cron}} in one terminal (as root). Then execute: {{command|run-parts /etc/cron.daily}} | ||
|results=Scripts in your directory were executed. | |results=Scripts in your directory were executed. | ||
# This can be verified by checking /var/log/cron, where are logged starting/finishing of jobs eg: | # The <code>--test</code> option will list all files which would be executed | ||
# The <code>--list</code> option will list all files, which are not filtered | |||
# This can be verified by checking {{filename|/var/log/cron}}, where are logged starting/finishing of jobs eg: | |||
Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[3204]: starting tmpwatch | Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[3204]: starting tmpwatch | ||
Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[6432]: finished tmpwatch | Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[6432]: finished tmpwatch | ||
}} | }} | ||
[[Category:Critical_path_test_cases]] | [[Category:Critical_path_test_cases]] | ||
[[Category:Package_cronie_test_cases]] |
Latest revision as of 02:24, 18 June 2011
Description
run-parts is able to run scripts in a directory. The command run-parts is most often used for cron.daily jobs.
How to test
As root try to execute run-parts with(out) options. Pay attention to directory, which you'll run. For example prelink
in /etc/cron.daily
runs quite long. You might need create your own directory with test files.
- Execute:
run-parts --test /etc/cron.daily
- Execute:
run-parts --list /etc/cron.daily
- Run the command
tail -f /var/log/cron
in one terminal (as root). Then execute:run-parts /etc/cron.daily
Expected Results
Scripts in your directory were executed.
- The
--test
option will list all files which would be executed - The
--list
option will list all files, which are not filtered - This can be verified by checking
/var/log/cron
, where are logged starting/finishing of jobs eg:
Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[3204]: starting tmpwatch Jan 4 08:39:47 hostname run-parts(/etc/cron.daily)[6432]: finished tmpwatch