这是我第一次为 cron 作业编写脚本。
我在 shell 中编写了我的代码(它可以工作),我正在尝试为 cron 设置它。所以这是我的问题。如何设置 cron?我想在
10 * * * * /home/workstation/deleter.sh
下面写(我希望它每 10 分钟运行一次)#!/bin/sh
吗?我将如何执行它?(deleter.sh 已通过 chmod 获得许可) man 1 crontab 返回“手册第 1 节中没有 crontab 条目”我现在真的很迷茫和困惑。如果有人知道如何设置 cron 请告诉我!!
提前致谢
#!/bin/sh
counter=0
logloc=/home/ServerLogs
backup=/home/test
## Reads the location of the file systems that needs to be investigated from location.txt
## and save it into an array
while read -r line; do
Unix_Array[${counter}]=$line;
let counter=counter+1;
done < location.txt
## Reads Email recipients and save it into an array
More code continues from here......