=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2337 - May 26, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
마지막 일요일에 실행하기

매월 마지막 일요일에 작업을 실행하려면, cron으로 다음의 문법을 사용할 있다.

 

18 * * * 0 [`date "+%d"` -gt 24] && /path/to/script

 

이 명령은 일요일 18시에 날짜가 24보다 큰지 체크하여 24보다 크다면 작업을

실행하라(만일 23을 지정하면 작업은 매월 마지막 2 일요일에 실행될 것이다)는

의미이다.


주: date 명령을 감싸고 있는 '`'는 작은 따옴표(')가 아니다.(~와 함께 있는 기호)

=====================================================

RUN ON LAST SUNDAY

If you want a job to run on the last
sunday of every month, you can use
the following syntax from within cron:

18 * * * 0 [`date "+%d"` -gt 24] && /path/to/script

i.e. on sundays at 18:00 check if
the day of the month is greater than
24 - if so run the job (if 23 is
specified the job will run on the last
2 sundays of the month)

NOTE: There back-ticks around the date
command, not single quotes.

This tip generously supported by: duncan.ferguson@egg.com

반응형
Posted by She쥐포s

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.3
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

최근에 올라온 글

최근에 달린 댓글

글 보관함