Job manager notifying to Slack.
Slack implemented direct message to myself. this command notify you an end of commands on Slack.
- You have to prepare config file on your home directory
~/.exslackrc
like this.
{
"webHookURL": "https://hooks.slack.com/services/X..../Y....",
"destination": "@rompei",
"logDir": "/home/rompei/log",
"maxAge": 7,
"maxBackups": 5,
"maxSize": 100
}
- webHookURL: URL of incoming web hook of Slack.
- destination: User name or channel name you want to notify to.
- logDir(optional): If you need output of commands, set this varialbe or set from command line option
-logfile
. - maxAge(optional): max age of log file (Default: 7 days).
- maxBackups(optional): The number of log files (Default: 5 files).
- maxSize(optional): Size of a log file (Default: 100MB).
- You have to prepare command list file like this.
./test1.sh xyz
./test2.sh abc
- Execute this command with command list file.
./exslack commands.txt
-
When the command finish, notify you on channel you specified. And if you set log file, an output will be written the log file.
-
Also we can execute command instantly
./exslack echo "aaa"
Usage of ./exslack:
-conc
Execute commands concurrently.
-cpus uint
How many CPUs to execution. (default 1)
-jobs string
List of jobs.
-logfile string
If you need output of commands, please set this flag or set directory from config file.