월간 인기 게시물

게시물 1,372건
   
run-parts
글쓴이 : 최고관리자 날짜 : 2017-05-17 (수) 14:57 조회 : 10120
글주소 :
                                
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/
 --> 아무런 리스트가 출력되지 않는다.

# ls
drop_cache
# 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.


이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.