Linux command
rtcwake 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Show
sudo rtcwake -m show -v
Example
sudo rtcwake -m mem -s 10
Example
sudo rtcwake -m disk --date +15min
Freeze
sudo rtcwake -m freeze --date [YYYYMMDDhhmm]
Disable
sudo rtcwake -m disable
Dry run
sudo rtcwake -m mem -s 600 -n
List supported wake modes
rtcwake --list-modes
说明
rtcwake enters a system sleep state and configures the RTC (Real-Time Clock) to wake the system at a specified time. It's useful for scheduled tasks, power saving, and automatic system wake. The tool supports various sleep modes with different power/wake trade-offs. The RTC alarm persists even if the system loses power (battery backup).
参数
- -m, --mode _mode_
- Sleep / action mode (see MODES).
- -s, --seconds _sec_
- Wake _sec_ seconds from now.
- -t, --time _time_t_
- Wake at the absolute Unix epoch time _time_t_.
- --date _timestamp_
- Wake at the given timestamp (e.g. `+5min`, `2026-04-30 18:00`, `tomorrow 03:00`).
- -d, --device _rtc_
- Use the specified RTC device (default /dev/rtc0).
- -l, --local
- Treat the hardware clock as local time.
- -u, --utc
- Treat the hardware clock as UTC.
- -a, --auto
- Read the clock interpretation from /etc/adjtime (default).
- -A, --adjfile _file_
- Use _file_ instead of /etc/adjtime.
- -n, --dry-run
- Test mode — set up the alarm but do not actually suspend or shut down.
- --list-modes
- Print modes the running kernel supports.
- -v, --verbose
- Verbose output.
- -V, --version
- Print version and exit.
FAQ
What is the rtcwake command used for?
rtcwake enters a system sleep state and configures the RTC (Real-Time Clock) to wake the system at a specified time. It's useful for scheduled tasks, power saving, and automatic system wake. The tool supports various sleep modes with different power/wake trade-offs. The RTC alarm persists even if the system loses power (battery backup).
How do I run a basic rtcwake example?
Run `sudo rtcwake -m show -v` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -m, --mode _mode_ do in rtcwake?
Sleep / action mode (see MODES).