我只是想问这里有没有人知道如何在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/