0

I'm trying to run AWS CLI commands every week for a backup. Basically, the commands that I want to run are:

aws configure set aws_access_key_id "access_key" --profile user2 && aws configure set aws_secret_access_key "secret_key" --profile user2 && aws configure set region "us-east-2" --profile user2 && aws configure set output "text" --profile user2

aws s3 ls --endpoint-url=https://s3.wasabisys.com

aws s3 sync <SOURCE-BUCKET> <DESTINATION-BUCKET> --endpoint-url=https://s3.wasabisys.com

It works when I run these commands in AWS CloudShell, but I want to run them automatically every week. How can I achieve that?"

jikuja
  • 459
  • 2
  • 16
Gerson
  • 11
  • 1
  • If you want to run AWS functionality on a schedule, write an AWS Lambda function in a supported programming language and then set a CRON Expression that determines the schedule it's invoked. – smac2020 Mar 29 '23 at 19:26
  • Why the azure tag? There's no mention of Azure anywhere in your question. – CSharpRocks Mar 29 '23 at 20:09
  • CloudShell stops running when it is not being used. Do you have a computer anywhere on the Internet that is running 24x7? If so, you can add a cron job (Linux) or Scheduled Task (Windows) to run these commands. – John Rotenstein Mar 29 '23 at 20:57

0 Answers0