All the commands below are executed using root user
- Install go and git if you not already do so
- You need to specify workspace directory, this can be any path in your system. For this example, i use the following directory as the workspace - /home/amd/go
- Set the $GOPATH to this workspace directory
- Change directory to your workspace directory and run the following command to get the jobber files.
- As git supplied by CentOS 6 is version 1.7.1 and it cannot handle gopkg.in in package properly. If this is not down, you will encounter hang problem during compilation process. So you need to manually get the yaml.v2 package.
- Compile jobber package
- Before proceed to next step, install daemonized if not already do so.
- Install jobber
- Running the following command and you can see jobber service is running.
- To create a scheduled job, you need to create .jobber file under user home directory. jobber file are written in YAML format.
- Once it is created, you need to load the job
- You can check the log of the job using this command.
yum install go yum install git
export GOPATH=/home/amd/go
go get github.com/dshearer/jobber
git clone --branch v2 https://github.com/go-yaml/yaml $GOPATH/src/gopkg.in/yaml.v2
make -C src/github.com/dshearer/jobber
yum install daemonize
make install -C src/github.com/dshearer/jobber
service jobber status
--- - name: DailyBackup cmd: backup daily time: 0 0 13 onError: Stop notifyOnError: false notifyOnFailure: true
/usr/local/bin/jobber reload
/usr/local/bin/jobber log
No comments:
Post a Comment