#!/bin/bash
# 1. Standardize PATH
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# 2. Wasabi Keys (Option 2 - Hardcoded for reliability)
export AWS_ACCESS_KEY_ID="X07Z3FM8CS0LPT3MJ1ZT"
export AWS_SECRET_ACCESS_KEY="XKkorNBnE0QY5PGWYsGdmt9Wqr96bk3geYjJaf5W"

# 3. Move to the folder containing the resized images
cd /home/bonstphotos3/public_html/resizedImages1

# 4. Move the files to Wasabi
# This command clears the local folder as it uploads
aws s3 mv ./ s3://mlsgrid/ --recursive --endpoint-url=https://s3.wasabisys.com

# 5. TRIGGER THE DATABASE UPDATE
# Using your specific PHP path and the absolute path to the script
/usr/local/bin/php /home/bonstphotos3/public_html/markWasabiComplete1.php