我想在Beaglebone黑色中运行一些代码,而无需执行ssh,当我使用电源时。在beaglebone黑色中运行没有ssh的代码
我试过把一些命令运行在~/.bashrc
文件中的代码,但它只适用于当我登录使用ssh
。我用/etc/rc.local
文件尝试过同样的事情,但在ssh之后仍然没有工作。
我也试过@reboot my_command
在crontab -e
但它也需要我使用SSH登录 任何建议?
编辑:
输出的[email protected]:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.6 (jessie)
Release: 8.6
Codename: jessie
[email protected]:~# ps aux | grep cron | grep -v grep
root 295 0.0 0.3 4428 1988 ? Ss 15:03 0:00 /usr/sbin/cron -f
crontab -e
:最后几行
[email protected]:~# crontab -e
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
#@reboot /root/wiringBone-master/library/main not working
#*/5 * * * * /root/wiringBone-master/library/main works
main
是我想要运行
它支持'cron'和'init'。你能解释一下在我的情况下如何使用它们吗?启动时在'some_location'处说'execute_some'命令。 – Rahul
你知道它使用哪种cron的味道吗? –
http://unix.stackexchange.com/questions/188042/running-a-script-during-boot-startup-init-d-vs-cron-reboot可能会对语法有所帮助。 –