Commit initial après suppression de l'historique
This commit is contained in:
32
backup_and_restore/scaleway/chamgement_class_standard.sh
Executable file
32
backup_and_restore/scaleway/chamgement_class_standard.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script initiates restoration requests for objects listed in a specified file.
|
||||
# It requires the bucket name, file name, and the number of days for the restoration.
|
||||
|
||||
# Example usage:
|
||||
# ./restore-glacier-objects.sh my-bucket object-list.txt 3
|
||||
# (Initiates restoration for objects listed in 'object-list.txt' in 'my-bucket' for 3 days)
|
||||
|
||||
# Check the number of arguments
|
||||
if [[ $# -ne 3 ]]; then
|
||||
echo "Usage: $0 <bucket_name> <file_name> <number_of_days>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Retrieve arguments
|
||||
BUCKET="$1"
|
||||
FILE="$2"
|
||||
DAYS="$3"
|
||||
|
||||
# Check if the file exists
|
||||
if [[ ! -f "$FILE" ]]; then
|
||||
echo "Error: The file '$FILE' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Iterate through the file and initiate restoration requests
|
||||
while read -r KEY; do
|
||||
aws s3api restore-object --restore-request Days=$DAYS --bucket $BUCKET --key "$KEY"
|
||||
done < "$FILE"
|
||||
|
||||
echo "Restoration requests initiated for objects listed in '$FILE'."
|
||||
Reference in New Issue
Block a user