I have scheduled EC2 instance to start every morning using Lambda. I have configured some task in task scheduler which I want it to run once EC2 is up however task wont get triggered until I login to EC2 instance. I want my task scheduler runs automatically at defined time without login to EC2 instance. Its a windows instance.
I tried configuring task without login but it doesn’t invoke.
2
Answers
Did you choose the
Run whether user is logged on or not
option of the task?Fix Scheduled Task Won’t Run for .BAT File
To run a script every time an Amazon EC2 instance starts, simply add the script to this directory:
Most Amazon EC2 AMIs have
cloud-init
installed. It is responsible for running scripts from User Data. It will also check the above directory and run any scripts it finds there. This does not require a user to login.