跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • Debian10如何开机自启shell脚本?Debian10没有rc.local了
未分類
1 2 月 2020

Debian10如何开机自启shell脚本?Debian10没有rc.local了

mymyhope 大佬有话说 :

Debian10如何开机自启shell脚本?Debian10没有rc.local了

谷歌也谷歌不到 百度也没有答案?????
打的Debian10 要怎么开机自启shell?

update-rc.d试过了 无效

kzklot 大佬有话说 :

本帖最后由 kzklot 于 2020-2-1 23:53 编辑

安裝….cron….這個是定時執行的…不知道合適使用與否….yc022t

apt-get update &&
apt-get install cron -y &&
systemctl start cron &&
systemctl enable cron

crontab -e
0 * * * * /etc/xxx.sh

時間如何設定可參考
https://crontab.guru/every-1-hour

一位不知名网友 大佬有话说 :

是吗 那太香了

萌䒤萌 大佬有话说 :

systemd了啊,自己新建个服务啊

HaoLan 大佬有话说 :

systemd,在/lib/systemd/system里面添加一个.service,然后systemctl enable xxx,就是这么简单

capric 大佬有话说 :

使用oneshot类型系统服务
Type=oneshot
如果有更进一步要求可以参考下这个:
https://unix.stackexchange.com/questions/320400/systemd-oneshot-requirement-to-execute-only-once

h2o 大佬有话说 :

crontab   @reboot

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具