Junos
Reply
Contributor
Zlatko
Posts: 24
Registered: ‎11-26-2009
0

Request System Reboot At Juniper JUNOS Explained.

[ Edited ]

Hello. I just would like to take a moment to clear something up, which has been bugging me for a while now.

 

I don't believe that the bulletins which Juniper has provided regarding the command

 

request system reboot at are correct.

 

What I would like to do is provide 3 examples to make this functional and useful for anyone working on devices.

 

Scenario 1:

I would like to reboot the router at 00:00 tomorrow, and today is June 28th, 2011, command to run:

 

Syntax:

request system reboot at yymmdd

Example:

request system reboot at 110629

 

Scenario 2:

I would like to reboot the router tomorrow at 04:00 (4 am), and today is June 28th, 2011, command to run:

 

Syntax:

request system reboot at yymmddhhmm

Example:

request system reboot at 1106290400

 

Scenario 3:

I would like to reboot the router tomorrow at 17:00 (5 pm), and today is June 28th, 2011, command to run

 

Syntax:

request system reboot at yymmddhhmm

Example:

request system reboot at 1106291700

 

Thanks, and I hope this clarifies for those who have been looking for this information.

Distinguished Expert
aarseniev
Posts: 1,544
Registered: ‎08-21-2009
0

Re: Request System Reboot At Juniper JUNOS Explained.

Hello,

You almost got it right except one needs to specify year in 4-digit format. Year in 2-digit format does not pass sanity check

--- JUNOS 10.4R4.5 built 2011-05-06 05:02:48 UTC
user@host> request system reboot at 110701 
Reboot the system at 110701? [yes,no] (no) yes 

error: that time is already past.

user@host> request system reboot at 20110701 
Reboot the system at 20110701? [yes,no] (no) yes 

Shutdown at Fri Jul  1 00:00:00 2011.
[pid 27722]

user@host> show system reboot 
reboot requested by remote at Fri Jul  1 00:00:00 2011
[process id 27722]

user@host> clear system reboot 
reboot requested by remote at Fri Jul  1 00:00:00 2011
[process id 27722]
Terminating...

user@host> request system reboot at 201107011700 
Reboot the system at 201107011700? [yes,no] (no) yes 

Shutdown at Fri Jul  1 17:00:00 2011.
[pid 27734]

user@host> show system reboot 
reboot requested by remote at Fri Jul  1 17:00:00 2011
[process id 27734]

user@host> clear system reboot 
reboot requested by remote at Fri Jul  1 17:00:00 2011
[process id 27734]
Terminating...

 HTH

Rgds

Alex

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Contributor
Zlatko
Posts: 24
Registered: ‎11-26-2009
0

Re: Request System Reboot At Juniper JUNOS Explained.

Here is what I just tried out:

 

user@root> show system uptime
Current time: 2011-06-29 07:18:03 UTC
System booted: 2011-06-29 07:09:37 UTC (00:08:26 ago)
Protocols started: 2011-06-29 07:13:46 UTC (00:04:17 ago)
Last configured: 2011-05-06 07:05:19 UTC (7w5d 00:12 ago) by root
 7:18AM  up 8 mins, 1 user, load averages: 0.09, 0.34, 0.22

user@root> request system reboot at 1106290800
Reboot the system at 1106290800? [yes,no] (no) yes

Shutdown at Wed Jun 29 08:00:00 2011.

user@root> clear system reboot
reboot requested by user at Sun Jun  5 00:00:00 2011
[process id 976]
Terminating...

user@root> request system reboot at 201106290800
Reboot the system at 201106290800? [yes,no] (no) yes


*** System shutdown message from user@root ***
System going down at 08:00


Shutdown at Wed Jun 29 08:00:00 2011.
[pid 989]

user@root> clear system reboot
reboot requested by user at Wed Jun 29 08:00:00 2011
[process id 989]
Terminating...

user@root> request system reboot at 110701
Reboot the system at 110701? [yes,no] (no) yes

error: that time is already past.

user@root> request system reboot at 110107
Reboot the system at 110107? [yes,no] (no) yes

error: that time is already past.

user@root> request system reboot at 110701
Reboot the system at 110701? [yes,no] (no) yes

error: that time is already past.

user@root>

 

I believe it might have problems with leading 0's when entering this date format.

 

Can you try it out on your machine? I'm running JUNOS 11.1R2.3

Distinguished Expert
aarseniev
Posts: 1,544
Registered: ‎08-21-2009

Re: Request System Reboot At Juniper JUNOS Explained.

Of course.

If one tries 2-digit year _with_ hours and minutes specified, then all is fine:

 

user@host> request system reboot at 1107011200 
Reboot the system at 1107011200? [yes,no] (no) yes 

Shutdown at Fri Jul  1 12:00:00 2011.
[pid 8435]

{master}
user@host> clear system reboot 
reboot requested by remote at Fri Jul  1 12:00:00 2011
[process id 8435]
Terminating...

{master}
user@host> request system reboot at 1107010000    
Reboot the system at 1107010000? [yes,no] (no) yes 

Shutdown at Fri Jul  1 00:00:00 2011.
[pid 8453]

 But if one tries 2-digit year _without_ hours/minutes hoping to schedule reboot at midnight, then sanity check prevents that:

 

{master}
user@host> request system reboot at 110701        
Reboot the system at 110701? [yes,no] (no) yes 

error: that time is already past.

{master}
user@host> show system reboot 
No shutdown/reboot scheduled.

 HTH

Rgds

Alex

___________________________________
Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.