I need a solution that can stop my notebook instance when it is idle or not in use
I was trying working with lifecycle configuration but when I add it to my instance, I am unable to start it
I added this code
#!/bin/bash
set -e
IDLE_TIME=300
echo “Fetching the autostop script”
wget -O autostop.py https://raw.githubusercontent.com/mariokostelac/sagemaker-setup/master/scripts/auto-stop-idle/autostop.py
echo “Starting the SageMaker autostop script in cron”
(crontab -l 2>/dev/null; echo “*/5 * * * * /bin/bash -c ‘/usr/bin/python3 $DIR/autostop.py –time ${IDLE_TIME} | tee -a /home/ec2-user/SageMaker/auto-stop-idle.log'”) | crontab –
echo “Changing cloudwatch configuration”
curl https://raw.githubusercontent.com/mariokostelac/sagemaker-setup/master/scripts/publish-logs-to-cloudwatch/on-start.sh | sudo bash -s auto-stop-idle /home/ec2-user/SageMaker/auto-stop-idle.log
But still was unable to start the instance
suggula saikrishna is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.