定制 genkgo/srvcleaner 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

genkgo/srvcleaner

Composer 安装命令:

composer require genkgo/srvcleaner

包简介

CLI tool to clean up your server (e.g. remove files and directories that are overdue)

README 文档

README

CLI tool to clean up your server (e.g. remove files and directories that are overdue)

Installation

Requires PHP 5.5 or later. There are no plans to support PHP 5.4 or PHP 5.3. In case this is an obstacle for you, conversion should be no problem. The library is very small.

It is installable and autoloadable via Composer as genkgo/srvcleaner.

Quality

Scrutinizer Code Quality Code Coverage Build Status

To run the unit tests at the command line, issue phpunit -c tests/. PHPUnit is required.

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Getting Started

Build your phar

vendor/bin/box build -c box.json

Create a config file

The config containing your cleanup tasks. Remove directories (including contents) or remove files.

{
  "name": "Test Cleaner",
  "tasks": [{
      "name" : "removeTmp",
      "src": "CleanUpDirectories",
      "config": {
        "path": "/tmp",
        "match": ["srvcleaner*"]
      }
    },{
      "name" : "removeTmp",
      "src": "CleanUpFiles",
      "config": {
        "path": "/tmp",
        "match": ["*.tmp"]
      }
    }
  ]
}

If you are removing backups that are overdue, use the following settings to remove backups older than 30 days.

{
  "name": "Test Cleaner",
  "tasks": [{
      "name" : "removeTmp",
      "src": "CleanUpFiles",
      "config": {
        "path": "/tmp",
        "match": ["*.tar.gz"],
        "modifiedAt": "P30D"
      }
    }
  ]
}

Run the command

phar/srvcleaner.phar clean -c srvcleaner.json

Contributing

  • Found a bug? Please try to solve it yourself first and issue a pull request. If you are not able to fix it, at least give a clear description what goes wrong. We will have a look when there is time.
  • Want to see a feature added, issue a pull request and see what happens. You could also file a bug of the missing feature and we can discuss how to implement it.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固