1 Answer
- Newest
- Most votes
- Most comments
0
Hello,
Yes, you can initiate the restore of multiple objects in an S3 bucket using the AWS CLI.
First, create a text file (objects-to-restore.txt) listing the objects you want to restore, with each object's key on a new line:
Monch01.mp4
Monch02.mp4
Monch03.mp4
Use the following shell script to initiate the restore for each object listed in the file:
BUCKET_NAME="your-bucket-name"
DAYS=7 # Number of days to keep the restored objects available
while read -r OBJECT_KEY; do
aws s3api restore-object --bucket "$BUCKET_NAME" --key "$OBJECT_KEY" --restore-request Days=$DAYS
done < objects-to-restore.txt
This script will read each object key from the objects-to-restore.txt file and initiate the restore process using the aws s3api restore-object command.
- Make sure you have the AWS CLI installed and configured with the necessary permissions to restore objects in your S3 bucket.
aws configure
