centos 7 设置开机启动脚本
vi /etc/rc.d/rc.local
在末尾追加 sh脚本 sh脚本要提前赋予执行权限 下面是测试,开机同步北京时间
[root@commonTest bin]# vi /usr/local/bin/data.sh
#!bin/bash ntpdate ntp1.aliyun.com
[root@commonTest bin]# chmod data.sh [root@commonTest bin]# vim /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local /usr/local/bin/date.sh
centos 7 设置开机启动脚本的更多相关文章
- ubuntu-18.04 设置开机启动脚本-亲测有效
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.local重新发挥作用. 2.将下列内容复制进rc-local.servi ...
- ubuntu-18.04 设置开机启动脚本
ubuntu-18.04 设置开机启动脚本 参阅下列链接 https://askubuntu.com/questions/886620/how-can-i-execute-command-on-sta ...
- Ubuntu 18.04 设置开机启动脚本 rc.local systemd
ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.l ...
- ubuntu高版本如何设置开机启动脚本
ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本 可以通过下列简单设置后,可以使rc.local重新发挥作用. 1.建立rc-local.service文件 ...
- Ubuntu 16.04设置开机启动脚本的方法
需求:公司卡片机容量太小,只有100G,由于使用的人比较的多,开机使用后有时候就会出现磁盘空间占满数据写不进去的情况,影响工作进度,而且每次使用完都得关掉卡片机,所以就有必要写个清理磁盘的脚本,当卡片 ...
- Ubuntu 14.04设置开机启动脚本的方法
rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #! ...
- ubuntu设置开机启动脚本
rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #! ...
- Fedora 21 设置开机启动脚本
sudo touch /etc/rc.d/rc.localsudo vim /etc/rc.d/rc.local 在/etc/rc.d/rc.local文件中写入, 然后使用:wq命令 保存并退出. ...
- Ubuntu-18.04设置开机启动脚本
参考:https://www.cnblogs.com/defifind/p/9285456.html http://www.cnblogs.com/airdot/p/9688530.html s ...
随机推荐
- 理解Throughput和Latency
Throughput,中文译作吞吐量.Latency,中文译作延迟.它们是衡量软件系统的最常见的两个指标. 吞吐量一般指相当一段时间内测量出来的系统单位时间处理的任务数或事务数(TPS).注意“相当一 ...
- 快速部署业务类为webapi服务
接着前一篇博文,将接口快速打包固定请求格式,不需要修改代码,可以自动完成接口调用,实际上就是生成了一个接口的代理类. 那么仅仅是接口请求代理,没有服务端怎么行?所以需要将实现接口的类部署为webapi ...
- linux改变内核参数
- printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - 输出格式转换
总览 (SYNOPSIS) #include <stdio.h> int printf(const char *format, ...); int fprintf(FILE *stream ...
- poj 1845 Sumdiv (等比求和+逆元)
题目链接:http://poj.org/problem?id=1845 题目大意:给出两个自然数a,b,求a^b的所有自然数因子的和模上9901 (0 <= a,b <= 50000000 ...
- tracert显示为超时
1.那一跳禁PING2.那一跳不对TTL超时做响应处理,直接丢弃3.MPLS VPN网络
- MySQL系列之三查询优化
通常来说,查询的生命周期大致可以按照顺序来看从客户端到服务端,然后在服务器上进行解析,生产执行计划, 执行,并返回结果给客户端.其中的执行阶段可以认为是整个生命周期中最重要的阶段,其中包括了大量为了检 ...
- mybatis源码分析之06二级缓存
上一篇整合redis框架作为mybatis的二级缓存, 该篇从源码角度去分析mybatis是如何做到的. 通过上一篇文章知道,整合redis时需要在FemaleMapper.xml中添加如下配置 &l ...
- HDU 6040 Hints of sd0061 —— 2017 Multi-University Training 1
Hints of sd0061 Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others ...
- <三剑客> 老三:grep命令用法
grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正 ...