Linux Bash shell 腳本定時器 All In One


Linux Bash shell 腳本定時器 All In One

自動化執行定時任務

Linux crontab 是用來定期執行程序的命令

demos

$ crontab -e

# 定時器任務test
# 每隔 30 分鍾運行一次,使用 sh 自動安裝 app-node-env
# 30 * * * * sh ./auto-install-npm.sh
30 * * * * /bin/sh ./auto-install-npm.sh


#!/bin/sh

# sh/zsh/bash 選擇默認

# echo "🚀 linux shell 定時器" && npm i -g app-node-env
echo "🚀 linux shell 定時器" && yarn global add app-node-env

# Linux Bash shell 腳本定時器 All In One
# https://www.cnblogs.com/xgqfrms/p/15384401.html



https://www.runoob.com/linux/linux-comm-crontab.html

demos

(🐞 反爬蟲測試!打擊盜版⚠️)如果你看到這個信息, 說明這是一篇剽竊的文章,請訪問 https://www.cnblogs.com/xgqfrms/ 查看原創文章!

corn

crontab guru

The quick and simple editor for cron schedule expressions by Cronitor

# At 08:00 on Sunday
0 8 * * 0

image

https://crontab.guru/#0_8___0

which

➜  ~ which sh
/bin/sh
➜  ~ which zsh
/bin/zsh
➜  ~ which bash
/bin/bash


➜  ~ which node
/Users/xgqfrms-mbp/.nvm/versions/node/v12.18.0/bin/node
➜  ~ which nginx
/usr/local/bin/nginx
➜  ~ which flutter
/Users/xgqfrms-mbp/Documents/Flutter/flutter/bin/flutter

refs

https://www.runoob.com/linux/linux-shell.html



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 發布文章使用:只允許注冊用戶才可以訪問!

原創文章,版權所有©️xgqfrms, 禁止轉載 🈲️,侵權必究⚠️!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM