Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shutdown and then reboot linux machine using python Language or shell script?

Tags:

python-2.7

Am trying to shutdown and boot it again the Linux system using python language or shell script. can anyone clarify me in this ? even crontab is also okay

like image 592
Asif Ali S Avatar asked Nov 29 '22 23:11

Asif Ali S


1 Answers

shell

reboot

python

import os
os.system('reboot')

Note: You need root permission to do reboot operation.

You should take some time to learn Linux basic concepts first.

like image 102
zydcom Avatar answered Dec 04 '22 15:12

zydcom