"모든 계정 crontab 작업 보기"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
8번째 줄: 8번째 줄:


;명령어
;명령어
<source lang='bash'>
<syntaxhighlight lang='bash'>
for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do crontab -u $user -l; done
for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do crontab -u $user -l; done


for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do echo $user; crontab -u $user -l; done (user도 표시)
for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do echo $user; crontab -u $user -l; done (user도 표시)
</source>
</syntaxhighlight>


;실행예시
;실행예시
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do crontab -u $user -l; done
[root@zetawiki ~]# for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do crontab -u $user -l; done
no crontab for root
no crontab for root
no crontab for mysql
no crontab for mysql
</source>
</syntaxhighlight>


==모든 계정 확인==
==모든 계정 확인==
;명령어
;명령어
<source lang='bash'>
<syntaxhighlight lang='bash'>
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
</source>
</syntaxhighlight>


;실행예시
;실행예시
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
[root@zetawiki ~]# for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
no crontab for root
no crontab for root
38번째 줄: 38번째 줄:
no crontab for oprofile
no crontab for oprofile
no crontab for named
no crontab for named
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2024년 4월 21일 (일) 19:33 판

list all user crontab entries, list crontabs for all users
crontab 작업 목록 전체 보기, 모든 사용자 crontab 보기
크론작업 목록 보기

1 쉘 사용 계정 확인

리눅스에는 계정이 너무 많다. 쉘 사용 계정만 확인하면 될 것 같다.

명령어
for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do crontab -u $user -l; done

for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do echo $user; crontab -u $user -l; done (user도 표시)
실행예시
[root@zetawiki ~]# for user in $(grep /bin/bash /etc/passwd | cut -f1 -d:); do crontab -u $user -l; done
no crontab for root
no crontab for mysql

2 모든 계정 확인

명령어
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
실행예시
[root@zetawiki ~]# for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
no crontab for root
no crontab for bin
no crontab for daemon
no crontab for adm
... (생략)
no crontab for mysql
no crontab for oprofile
no crontab for named

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}