#!/bin/bash while [ 1 ] do job_error_no=`kubectl get pod -n weifeng |grep -i "job"|grep -ci error` if [ $job_error_no -gt 0 ];then ps -fe|grep k8s_job_status_monitor|grep -v grep|awk '{print $2}'|xargs kill -9 echo "k8s job running is not s
一.crontab调度 对于linux 自带crontab而言, xxx.sh的一般编写格式以#!/bin/bash 解释器开头,可在脚本中加入: date 但是,shell脚本执行 需要 x权限,执行的方式如下: ./xxx.sh sh ./xxx.sh 其中,后缀.sh 第一行#!/bin/bash 没有,需要使用sh命令去执行 1.crontab简单调度 [root@localhost ~]# crontab -e no crontab for root - using an e
在awk中可以直接执行shell命令. zoer@ubuntu:~$ touch a zoer@ubuntu:~$ touch b zoer@ubuntu:~$ cat a.txt a b zoer@ubuntu:~$ awk '{cmd="rm "$0;system(cmd)}' a.txt zoer@ubuntu:~$ ls a.txt dd important mysql py testdata da