benjy/platform-backup 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

benjy/platform-backup

Composer 安装命令:

composer require benjy/platform-backup

包简介

README 文档

README

Automated backup script that pulls the database, compresses, and syncs to an S3 bucket. Designed for Platform.sh

Install

You can either clone this repo and use as its own project or you can require it as a dependency into your existing project.

composer require benjy/platform-backup

Setup

  • composer install
  • Create IAM user with write access to a S3 bucket.
  • Add backups directory to .platform.app.yaml
mounts:
    "/backups": "shared:files/backups"
  • Add environmental variables in Platform.sh. Be sure to add the "env:" prefix.

    • env:AWS_ACCESS_KEY_ID
    • env:AWS_SECRET_ACCESS_KEY
    • env:S3_BUCKET (The name of the bucket you created)
    • env:LOGGLY_TOKEN (Get from loggly > source setup > tokens)
    • env:AWS_REGION (Optional, defaults to us-east-1)
    • env:PUBLIC_FILES_DIRECTORY (optional: If added use, full path [e.g. /app/app/sites/default/files])
    • env:PRIVATE_FILES_DIRECTORY (optional: If added use, full path [e.g. /app/private])
  • Add composer install to .platform.app.yaml

hooks:
    build: |
        composer install --working-dir=./jobs
  • Deploy and test using: php ./jobs/db_backup.php
  • Add cron task to .platform.app.yml
db_backup:
    spec: "0 0 * * *"
    cmd: "php ./jobs/db_backup.php"

Note, you might have to update the cmd to point to a different location depending on how you installed.

Credits

Adapted from https://bitbucket.org/snippets/kaypro4/gnB4E

统计信息

  • 总下载量: 4.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固