How can I run aws cli commands in scheduled?

272 Views Asked by At

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?"

0

There are 0 best solutions below