`

Linux 重启服务器命令

 
阅读更多
reboot -n
保存数据后重启

 

 

1: 查看reboot命令的帮助信息

[root@DB-Server ~]# reboot --help
usage: reboot [-n] [-w] [-d] [-f] [-h] [-i]
        -n: don't sync before halting the system
        -w: only write a wtmp reboot record and exit.
        -d: don't write a wtmp record.
        -f: force halt/reboot, don't call shutdown.
        -h: put harddisks in standby mode.
        -i: shut down all network interfaces.

[root@DB-Server ~]# man reboot

[root@DB-Server ~]# man reboot
HALT(8)               Linux System Administrator鈥檚 Manual              HALT(8)
 
NAME
       halt, reboot, poweroff - stop the system.
 
SYNOPSIS
       /sbin/halt [-n] [-w] [-d] [-f] [-i] [-p] [-h]
       /sbin/reboot [-n] [-w] [-d] [-f] [-i]
       /sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]
 
DESCRIPTION
       Halt notes that the system is being brought down in the file /var/log/wtmp, and then either tells the kernel to halt, reboot or poweroff the system.
 
       If  halt  or reboot is called when the system is not in runlevel 0 or 6, in other words when it鈥檚 running normally, shutdown will be invoked instead (with
       the -h or -r flag). For more info see the shutdown(8) manpage.
 
       The rest of this manpage describes the behaviour in runlevels 0 and 6, that is when the systems shutdown scripts are being run.
 
OPTIONS
       -n     Don鈥檛 sync before reboot or halt. Note that the kernel and storage drivers may still sync.
 
       -w     Don鈥檛 actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
 
       -d     Don鈥檛 write the wtmp record. The -n flag implies -d.
 
       -f     Force halt or reboot, don鈥檛 call shutdown(8).
 
       -i     Shut down all network interfaces just before halt or reboot.
 
       -h     Put all harddrives on the system in standby mode just before halt or poweroff.
 
       -p     When halting the system, do a poweroff. This is the default when halt is called as poweroff.
 
DIAGNOSTICS
       If you鈥檙e not the superuser, you will get the message 鈥榤ust be superuser鈥?  Users logged in locally on the console can call  halt,  reboot,  and  poweroff
       without supplying the root password, due to pam_console (8).
 
NOTES
       Under  older sysvinit releases , reboot and halt should never be called directly. From release 2.74 on halt and reboot invoke shutdown(8) if the system is
       not in runlevel 0 or 6. This means that if halt or reboot cannot find out the current runlevel (for example, when /var/run/utmp  hasn鈥檛  been  initialized
       correctly) shutdown will be called, which might not be what you want.  Use the -f flag if you want to do a hard halt or reboot.
 
       The  -h  flag puts all harddisks in standby mode just before halt or poweroff. Right now this is only implemented for IDE drives. A side effect of putting
       the drive in standby mode is that the write cache on the disk is flushed. This is important for IDE drives, since the kernel doesn鈥檛 flush the write-cache
       itself before poweroff.
 
       The  halt  program  uses  /proc/ide/hd* to find all IDE disk devices, which means that /proc needs to be mounted when halt or poweroff is called or the -h
       switch will do nothing.
 
AUTHOR
       Miquel van Smoorenburg, miquels@cistron.nl
 
SEE ALSO
       shutdown(8), init(8), pam_console(8)
 
                                  Nov 6, 2001                          HALT(8)
(END) 

 

 2:强制重新开机,不调用shutdown指令的功能

 

[root@DB-Server ~]# reboot -f

 

3:关闭网络设置之后再重新启动系统

[root@DB-Server ~]# reboot -i
 
Broadcast message from root (pts/1) (Mon Jul 28 11:31:28 2014):
 
The system is going down for reboot NOW!
 

 

4:保存数据后再重新启动系统

[root@DB-Server ~]# reboot -n
 
Broadcast message from root (pts/1) (Mon Jul 28 11:33:57 2014):
 
The system is going down for reboot NOW!
 

 

5:重新启动时不把数据写入记录文件/var/tmp/wtmp

 

 

[root@DB-Server ~]# reboot -d
 
Broadcast message from root (pts/2) (Mon Jul 28 11:23:26 2014):
 
The system is going down for reboot NOW!

 

关机命令:

1、halt   立刻关机
2、poweroff  立刻关机
3、shutdown -h now 立刻关机(root用户使用)
4、shutdown -h 10 10分钟后自动关机
如果是通过shutdown命令设置关机的话,可以用shutdown -c命令取消重启

重启命令:

1、reboot
2、shutdown -r now 立刻重启(root用户使用)
3、shutdown -r 10 过10分钟自动重启(root用户使用) 
4、shutdown -r 20:35 在时间为20:35时候重启(root用户使用)
如果是通过shutdown命令设置重启的话,可以用shutdown -c命令取消重启

分享到:
评论

相关推荐

    Linux关机和重启服务器命令详解

    "Linux关机和重启服务器命令详解" Linux 系统中有多种关机和重启命令,每种命令都有其特点和用法。了解这些命令的使用方法和参数可以帮助用户更好地管理 Linux 系统。 shutdown 命令 shutdown 命令可以安全地将...

    linux重启oracle相关服务

    方法二是使用 Sql 代码,通过 cd $ORACLE_HOME/bin 进入 Oracle 安装目录,然后使用 ./dbstart 和 ./lsnrctl start 命令来重启服务器和监听器。方法三是使用 Oracle 身份登录数据库,然后使用 startup 命令启动...

    Linux服务器部署常用命令

    ### Linux服务器部署常用命令知识点详解 #### 一、概述 在Linux系统中,掌握一系列的基础命令对于日常管理和服务器部署至关重要。这些命令可以帮助我们快速高效地完成各种任务,从简单的网络配置到复杂的数据库...

    Linux批量命令执行工具 可批量对多个Linux主机执行命令 重启后依然可以 方便省力 适合统一化管理Linux服务器 Linux 远程管理

    在IT行业中,Linux系统的管理是一项重要的任务,尤其在大规模的服务器集群环境中,高效地执行命令和维护一致性至关重要。本文将详细介绍“Linux批量命令执行工具”的功能、用途以及它如何简化Linux服务器的统一化...

    linux重启服务器的tomcat

    ### Linux重启服务器上的Tomcat知识点详解 #### 一、引言 在Linux环境下管理服务器时,经常需要重启Tomcat服务来更新应用或者处理故障。本文将详细介绍如何在Linux系统下重启Tomcat服务的过程,包括登录服务器、...

    linux服务器关机、重启、注销命令.docx

    Linux 服务器关机、重启、注销命令详解 Linux 服务器关机、重启、注销命令是 Linux 系统中常用的命令,管理员可以使用这些命令来控制服务器的状态。在这篇文章中,我们将详细介绍 Linux 服务器关机、重启、注销...

    linux服务器关机、重启、注销命令.pdf

    该命令可以让管理员在特定的时间点关机或重启服务器。使用 shutdown 命令时,管理员可以指定关机或重启的时间、方式和其他选项。 shutdown 命令的基本语法为:shutdown [选项] [时间] 其中,选项可以是 -h、-r 等...

    Linux服务器维护常用命令

    ### Linux服务器维护常用命令知识点详解 #### 一、概述 在Linux服务器的日常维护工作中,掌握一系列关键命令是必不可少的技能。这些命令可以帮助系统管理员高效地监控、管理和维护服务器环境。根据提供的信息,我们...

    Linux中一键重启postgresql的脚本命令

    Linux中一键重启postgresql的脚本命令

    linux oracle重新启动

    ### Linux环境下Oracle数据库重启知识点详解 #### 一、概述 在Linux环境中,Oracle数据库的管理是常见的运维操作之一。为了确保系统的稳定运行,有时需要重启Oracle数据库及其监听器。本文将详细介绍在Linux环境下...

    Linux系统下操作Apache最基本的启动停止和重启命令

    本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况 apahce启动命令: ...要在重启 Apache 服务器时不中断当前的连接,则应运行: /usr/local/sbin/apachectl graceful 如果apac

    linux服务器命令用法笔记

    本篇笔记主要针对Linux服务器中的常用命令及用法进行了详尽的总结,旨在帮助初学者快速上手,并为有一定经验的用户提供参考。 1. **基础命令** - `ls`:列出目录内容,通过`-l`选项可显示详细信息。 - `cd`:切换...

    Linux下启动数据库服务命令

    关闭Linux系统使用`halt -p`,重启系统则使用`reboot`命令。 5. **Oracle数据库导入导出**: 查看当前数据库的SID,使用`echo $ORACLE_SID`。在Linux系统中,切换数据库环境使用`export ORACLE_SID=数据库名`。...

    Linux DHCP 服务器搭建

    在本文中,我们将详细介绍 Linux DHCP 服务器的搭建过程,并提供了详细的配置文件和命令示例,以便帮助读者更好地理解和掌握 DHCP 服务器的搭建。 DHCP 服务器的搭建需要具备一定的 Linux 基础知识和网络知识,对于...

    操作linux服务器的工具

    例如,当你需要更新服务器上的某个文件时,可以先在WinSCP中上传修改后的文件,然后在Xshell中运行相关命令,如重启服务或验证文件更新效果。这种组合使用方式大大提高了开发人员和运维人员的工作效率。 在提供的...

    Linux系统各种重启命令.docx

    在服务器中,我们较少对 Linux 系统进行系统重启,但是在以下情况下,我们需要对机器进行重启: * 更换硬件 * 更改系统配置 * 系统僵死,需要重启恢复 关闭和重启系统方式有多种,包括: * 关闭电源(下电) * ...

    linux系统服务器和工作站部分操作命令

    本文将详细介绍一些在Linux系统服务器和工作站中常见的操作命令,这些命令对于初学者来说尤其有帮助。 1. **启动和关闭数据库** - 启动数据库:在Linux环境下,通常通过特定脚本启动数据库服务。例如,在ON3000...

    Linux系统自动不停重启并计数的shell脚本

    Linux系统自动不停重启并计数的shell脚本

    远程重启服务器软件-适合于局域网内服务器

    "远程重启服务器软件"就是为了解决这种问题而设计的工具,尤其适用于那些无法通过常规远程控制服务进行登录和管理的场景。本文将深入探讨远程重启服务器的原理、应用场景及安全考虑。 首先,我们要理解远程重启的...

    在Linux服务器上每周自动重启WebSphere服务配置

    ### 在Linux服务器上每周自动重启WebSphere服务配置 #### 知识点概述 本文档将详细介绍如何在Linux环境中设置cron任务来实现WebSphere服务的自动重启。此方法不仅适用于WebSphere服务,还可广泛应用于需要定时执行...

Global site tag (gtag.js) - Google Analytics