run-parts - run scripts or programs in a directory
:: 특정디렉토리내에 스크립트나 프로그램을 실행시키는 명령어로 사전식(directory)....즉 알파벳 순서대로 정렬시켜서 실행하게된다.
OS : Ubuntu 16.04 LTS
# cat /etc/crontab
# m h dom mon dow user command
55 * * * * root cd / && run-parts --report /etc/cron.hourly
※ 주의사항
# man run-parts
If neither the --lsbsysinit option nor the --regex option is given then the names must consist entirely of ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens.
"번역하자면.... ascii 코드로 된 대/소문자, 숫자, 밑줄, 하이픈만 실행스크립트 이름으로 사용할수 있다"
# ls
drop_cache.sh
# run-parts --list /etc/cron.hourly/
--> 아무런 리스트가 출력되지 않는다.
# run-parts --list /etc/cron.hourly/
/etc/cron.hourly//drop_cache
CentOS 에서는 .sh 파일도 출력이된다.
OS : CentOS 7.X
# run-parts --list /etc/cron.hourly/
/etc/cron.hourly/0anacron
/etc/cron.hourly/drop_cache.sh
# run-parts
Usage: run-parts [--list | --test] <dir>
OS : Ubuntu 16.04
# run-parts --help
Usage: run-parts [OPTION]... DIRECTORY
--test print script names which would run, but don't run them.
--list print names of all valid files (can not be used with
--test)
-v, --verbose print script names before running them.
--report print script names if they produce output.
--reverse reverse execution order of scripts.
--exit-on-error exit as soon as a script returns with a non-zero exit
code.
--lsbsysinit validate filenames based on LSB sysinit specs.
--new-session run each script in a separate process session
--regex=PATTERN validate filenames based on POSIX ERE pattern PATTERN.
-u, --umask=UMASK sets umask to UMASK (octal), default is 022.
-a, --arg=ARGUMENT pass ARGUMENT to scripts, use once for each argument.
-V, --version output version information and exit.
-h, --help display this help and exit.