Linux .SH 程序

标签 linux sh

我只是想问这里有没有人知道如何在Linux中每天自动启动一个.sh程序。 这是因为我有一个正在运行的服务器,它运行到午夜的某个时间点然后停止。我想要一个可以每天在特定时间自动重新启动的程序。

最佳答案

您可以使用 cron 守护进程自动运行脚本

首先你必须将命令添加到 cron

crontab -e //this will open a file with your default editor
//to this file add your command at last

命令语法:

* * * * * * /home/loc/shell.sh  //runs every minuite

ex */45**** /home/loc/shllscript.sh  // runs every 45 mins

关于Linux .SH 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23906852/

相关文章:

bash - 这个访谈项目表明什么水平的专业知识?取消设置 foo;回音栏 |读 foo; echo $foo

linux tslib ts_read 不适用于多点触控显示

linux - 如何在网络(VPN 或 LAN)中查找已连接的主机

linux - 为什么系统调用失败?

python - 相当于 python 脚本的 sh 脚本

mysql - 如何将shell脚本变量作为OUT参数传递给mysql存储过程?

linux - 使用命令行从多个 HTML 页面创建动画 gif

c++ - 当磁盘快满时,使用 C++ 流缓冲区在 Linux 中复制文件没有异常?

linux - 如何从不可预测格式的文件中提取单行/多行正则表达式匹配项并将每个项放在一行中到输出文件中?

linux -/bin/sh "embedded linux"while do done - 需要 sleep 命令 - CPU 较少