Linux 查看所有用户crontab计划任务
[root@nf5-1000 ~]# awk -F ":" '{print $1}' /etc/passwd | xargs -I {} crontab -l -u {}
[root@nf5-1000 ~]# cat /etc/passwd | cut -f 1 -d : |xargs -I {} crontab -l -u {}
# for i in `awk -F':' '{if( $3>=0 )print $1 }' /etc/passwd `;do ([[ `crontab -u $i -l 2>&1 |grep -Ev '^no|^$' |wc -l` == 0 ]]&&(echo "$i;no_crontab") ||(echo "$i"&&crontab -u $i -l|grep -v '^#'))|sed ":a;N;s/\n/;/g;ta"|sed -r 's/[ ]+/+/g';done | awk '{print "{{ inventory_hostname }}",$0}'