0

I have a Windows EC2 instance in place. I cannot delete it every day since we have multiple tools installed like accessing Postgress RDS via Dbeaver. Now, we have an activity of deleting a few S3 folders. So using the Mobaxterm tool, I can delete it via AWS CLI commands.

However, I am unable to schedule this script which runs once daily in the morning. I explored a few posts which are not relevant to my problem. There, the user is trying to launch > run script > delete instance which I don't want to do.

What can be done in my case?

baduker
  • 19,152
  • 9
  • 33
  • 56
whatsinthename
  • 1,828
  • 20
  • 59
  • [schedule a task in windows](https://stackoverflow.com/questions/7195503/setting-up-a-cron-job-in-windows) – baduker Jun 02 '22 at 07:59

1 Answers1

1

At least two options come to mind:

  1. Use Windows task scheduler to create a task that will run your script daily directly on the instance
  2. Use AWS Systems Manager State Manager to run a custom document that will execute your script remotely on a daily basis

I would recommend the second option because you would be able to reuse it for other instances if needed.

Paolo
  • 21,270
  • 6
  • 38
  • 69