gkimball / backup2s3
Backup files to S3
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- aws/aws-sdk-php: ^3.21
- aws/aws-sdk-php-resources: ^0.3.0
- comodojo/zip: ^2.1
- spatie/db-dumper: ^2.4
This package is not auto-updated.
Last update: 2025-03-24 18:59:04 UTC
README
This script should backup the files in any directory, as well as X databases, and add them to a ZIP and shoot off to S3
##AWS CONFIGURATION##
- Create a USER (IAM)
- Assign that user a IAM POLICY (below)
- Create a Bucket for that users site.
- Get the Users credentials and add to the Child class of Backup
Example Backup Policy
Create a user with the PutObject IAM policy
The policy should look like this: (Where BUCKETNAME is the lowercase name of bucket)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::BUCKETNAME/*”
}
]
}
##INSTALLATION ON SITE
- clone this repo or
composer require "gkimball/backup2s3":"^1.0"
##USAGE
- Create an entry point like "examples/backup.php" and configure credentials.
- Add to a secure directory and run via CRON every month or so in the middle of the night.