承接 escuccim/s3backup 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

escuccim/s3backup

Composer 安装命令:

composer require escuccim/s3backup

包简介

Laravel shell command to backup files to Amazon S3

README 文档

README

Latest Version on Packagist Software License Build Status Total Downloads

This is a Laravel package that creates a console command to backup a file to Amazon S3.

Install

Via Composer -

$ composer require escuccim/s3backup

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

Escuccim\S3Backup\S3BackupServiceProvider::class,

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=

Usage

To Dump and Upload Database

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.

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.

All of these parameters are optional and if not specified defaults will be taken from the .env file.

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.

--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.

For Single Files

php artisan backup:file [file] [--dest=location to upload file to]

{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

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.

If you specify a file extension only files matching that will be uploaded.

Credits

License

The MIT License (MIT).

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固