当前位置:首页 > 未分类 > 正文内容

debian多条定时任务crontab -e 简单设置

jxcq2年前 (2024-03-24)未分类95

编辑:

crontab -e


15 * * * * /bin/bash /root/renwu/lzzycj.sh

20 * * * * /bin/bash /root/renwu/lzzycjxz.sh

#*/2 * * * * /bin/bash /root/renwu/lzzycj.sh >> /root/renwu/lzzycj.log 2>&1

#*/2 * * * * /bin/bash /root/renwu/lzzycjxz.sh >> /root/renwu/lzzycjxz.log 2>&1

#15 * * * * curl -k https://xxx.xxx/api.php/timming/index.html?enforce=1&name=lzicj

#20 * * * * curl -k https://xxx.xxx/api.php/timming/index.html?enforce=1&name=lzicj-down


创建批处理文件 sh

mkdir -p /root/renwu

nano lzzycj.sh

#!/bin/bash

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

export PATH

curl -k --connect-timeout 10 -m 3600 'https://xxx.xxx:8443/api.php/timming/index.html?enforce=1&name=lzicj'

#curl --insecure --connect-timeout 10 -m 3600 'https://xxx.xxx:8443/api.php/timming/index.html?enforce=1&name=lzicj'(无ssl认证)

#curl -sS --connect-timeout 10 -m 3600 'https://xxx.xxx:8443/api.php/timming/index.html?enforce=1&name=lzicj'(有ssl认证)

echo "----------------------------------------------------------------------------"

endDate=`date +"%Y-%m-%d %H:%M:%S"`

echo "★[$endDate] Successful"

echo "----------------------------------------------------------------------------"


重启定时任务

/etc/init.d/cron restart

service cron restart




扫描二维码推送至手机访问。

版权声明:本文由小强的小站发布,如需转载请注明出处。

本文链接:https://zblog.dragon2024.cloudns.ch/?id=48

分享给朋友:

“debian多条定时任务crontab -e 简单设置” 的相关文章

FRP内网穿透+openwrt-FRP客户端设置

1、一台vps主机2、ssh连接主机下载最新frp软件https://github.com/MvsCode/frps-onekeyhttps://github.com/fatedier/frpwget https://github.com/fatedier/frp/releases/dow...

omv5-omv6-换源-扩展插件-docker

ovm5换源:https://blog.csdn.net/weixin_39916479/article/details/119500845#安装omv-extras-pluginswget -O - https://github.com/OpenMediaVault-Plugin-Develope...

TC1-A2-mqtt-配置

https://github.com/yakinchang/phicomm_tc1_a2 固件配置获取插排分配到的 IP(根据自己的网络环境自行解决),IP 以 10.10.9.134 为例访问插排的 http 接口,获取插排状态,用户名密码都是 admin支持的接口列表:修改和查询wifi:htt...

docker安装openwrt-raymondwong/openwrt_r9

https://www.sjlx.win/auth/register?code=tIimMethod ONE(recommended): step1: ip link set enp5s0 promisc onstep2: docker network create -...

MBR-GPT模式grub2启动添加windows分区启动

MBRnano /boot/grub/grub.cfg### BEGIN /etc/grub.d/30_os_prober ###  #(自己更改系统名称)menuentry 'Windows 8.1'  {    &nbs...

debian安装docker通用方法

脚本安装wget -qO- get.docker.com | bash首先就是老方法卸载旧版本dockersudo apt-get remove docker docker-engine docker.io containerd runcsudo apt-get update安装软件包以允许使用 基...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。