我有一个名为的脚本run.sh
:
#!/bin/bash
cd /root/yowsup-master/src/
./yowsup-cli --interactive no --wait --autoack --config config.example
Run Code Online (Sandbox Code Playgroud)
此脚本执行另一个脚本。
我尝试添加我的脚本路径,/etc/rc.local
但它似乎不起作用。
我还将它添加到Kali Linux 的启动应用程序中,它也不起作用。
我希望我run.sh
在计算机启动时在后台自动执行。
简单。使用像这样的 crontab 条目:
@reboot /replace/with/the/path/to/run.sh
Run Code Online (Sandbox Code Playgroud)
要在您的系统上使用它,最好的方法是永远不要/etc/rc.local
手动编辑,而只需运行crontab -e
以编辑您的 crontab 条目。更多详情请见本网站。