QuestionQ35

Operations

An administrator is creating a cron job that shuts down virtual machines overnight to reduce costs. Which of the following is the best way to accomplish this task?

Explanation

A virtual machine should be shut down only when its reported status equals running. The == conditional operator performs the required string comparison, ensuring shutdown_vm(X) is called for running virtual machines and the stopped message is used otherwise.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!