2017 © Pedro Peláez
 

library s3backup

Laravel shell command to backup files to Amazon S3

image

escuccim/s3backup

Laravel shell command to backup files to Amazon S3

  • Saturday, February 18, 2017
  • by skooch
  • Repository
  • 1 Watchers
  • 2 Stars
  • 48 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

S3Backup

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads], (*1)

This is a Laravel package that creates a console command to backup a file to Amazon S3., (*2)

Install

Via Composer -, (*3)

``` bash $ composer require escuccim/s3backup, (*4)

Register the class in config/app.php 'providers' array:

Escuccim\S3Backup\S3BackupServiceProvider::class,, (*5)

You must specify the credentials to your Amazon S3 bucket in your .env file as follows:

AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= AWS_BUCKET=, (*6)


## Usage ### To Dump and Upload Database ```bash php artisan backup:db {--path=} {--db=} {--user=} {--dest=} {--keep} {--p} {--pass=}

This will dump the database specified in your .env file to your /database/ directory, upload the dump to S3, and then delete it locally., (*7)

Options: - path: by default the db will be dumped to your database directory, if you want to dump to a subdirectory specify this in path. - db: the name of the DB to dump, if you omit this it will use the DB from the .env file - user: the name of the user to use to dump, if you omit this it will use the username from the .env file - dest: the key to upload the file to in s3 - keep: use this flag if you want to keep the dump file locally, otherwise it will be deleted after upload - p: use this flag if you want to use the password in your .env file when generating the dump. If you do not use this flag no password will be specified. - pass: if you wish to use a password other than the one in the .env specify it here., (*8)

All of these parameters are optional and if not specified defaults will be taken from the .env file., (*9)

Note that --p is used to specify if you want to use a password at all, if you do not have a password for the local account or have credentials stored in a .my.cnf file you can omit this., (*10)

--pass= is used to specify a password, if you wish to use it you MUST use the --p flag as well. If you use --p with no password specified the password will be taken from the .env file., (*11)

For Single Files

``` bash php artisan backup:file [file] [--dest=location to upload file to], (*12)


{file} is the path to the file to upload relative to your project root. {dest} is the location to upload the file to. The file will keep the same name. Do not use trailing or leading "/"s on either the file or the destination. ### For Directories ```bash php artisan backup:dir [path] [--dest=location to upload file to] [--ext=file extension]

Where path is the path to the directory relative to the base path and dest is the base key to upload the files to. The final destination of the files will replace the path parameter with the dest parameter., (*13)

If you specify a file extension only files matching that will be uploaded., (*14)

Credits

License

The MIT License (MIT)., (*15)

The Versions

18/02 2017

dev-master

9999999-dev https://github.com/escuccim/s3backup

Laravel shell command to backup files to Amazon S3

  Sources   Download

MIT

The Requires

 

backup mysqldump escuccim amazon s3 backup db

18/02 2017

v0.2.0-beta.1

0.2.0.0-beta1 https://github.com/escuccim/s3backup

Laravel shell command to backup files to Amazon S3

  Sources   Download

MIT

The Requires

 

backup mysqldump escuccim amazon s3 backup db

07/02 2017

v0.1.0-beta.1

0.1.0.0-beta1 https://github.com/escuccim/s3backup

Laravel shell command to backup files to Amazon S3

  Sources   Download

MIT

The Requires

 

backup mysqldump escuccim amazon s3 backup db