2020
10-21
10-21
shell之定时周期性执行脚本的方法示例
示例1.编写测试脚本脚本time.sh$cattime.sh#!/bin/bashecho$(date+%s)>>/home/ocean/out.txt保存完毕后记得给予权限chmod777test.sh2.添加定时任务$crontab-enocrontabforocean-usinganemptyoneSelectaneditor.Tochangelater,run'select-editor'.1./bin/nano<----easiest2./usr/bin/vim.tiny3./bin/ed内容编辑为:每一分钟执行一次#mhdommondowcommand*****/home/ocean/wor...
继续阅读 >