Total Pageviews

Tuesday 21 June 2016

CommandTimer (命令定时器)

Build Status Gem Version Coverage Status Code Climate
Simple tool to execute commands on schedule. Designed for maintain web applications.

Installation

$ gem install command_timer

Usage

$ cmdtimer [options] COMMANDS_CONFIG_FILE

Options

-c, --count-downAssign the seconds to count down. (default 30s)
-s, --ntp-serverAssign the NTP server. (only ntp installed)

Config File Sample (YAML)

command1:
    description: "stop unicorn"
    burn_time: "14:00:00"
    content: |
        cd /path/to/app/
        cap unicorn:stop
command2:
    description: "deploy"
    burn_time:
    content: |
        cd /path/to/app/
        cap deploy
    observer: |
        cd /path/to/app/
        cap invoke COMMAND="tail -f /path/to/log/file"
command3:
    description: "start unicorn"
    burn_time: "16:00:00"
    content: |
        cd /path/to/app/
        cap unicorn:start

burn_time

HH:mm:ssexecute commands on time
blankexecute commands by user input
autoexecute commands after previous command ended。

from https://github.com/cctiger36/command_timer