Skip to content

alexcoder04/kangaroo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kangaroo

Runs a command if signaled or in specific time intervals

Installation

git clone https://github.com/alexcoder04/kangaroo.git
cd kangaroo

# build a binary and run it
go build .
./kangaroo

# install to your $GOPATH
go install .

Usage

Execute on signal

kangaroo -signal 2 echo "Hello World!"

This will execute echo "Hello World!" if kangaroo gets signaled with SIGRTMIN+2. If no signal number is passed, kangaroo assumes 1. If you pass 0 as signal number, kangaroo will not listen at all.

Execute in time intervals

kangaroo -interval 3 echo "Hello World!"

This will execute echo "Hello World!" every 3 seconds. If no number is passed, kangaroo will not execute your command periodically.