You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI: How to Automate Stop and Start of OCI Instances using OCI CLI

edited Oct 29, 2024 9:56AM in Linux 1 comment

APPLIES TO

Oracle Cloud Infrastructure

Linux OS

GOAL 

The main goal of this document is to explain how to automate stop and start of OCI Instances using OCI CLI from Linux instance which is running on OCI. 


 
SYMPTOMS

  • The scheduled cronjob failed to initiate the start and stop actions for Oracle Cloud Infrastructure (OCI) instances as planned. 
  • The cronjob was set up on a network-accessible server to manage the instances' power actions remotely. 
  • The provided command for the cronjob contained an incorrect path, leading to unexpected behavior.
     
     

CAUSE

The cronjob command executed from the path /home/opc/oci instead of the correct path /usr/bin/oci. This incorrect path resulted in the cronjob failing to initiate the desired actions. 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!