Giter VIP home page Giter VIP logo

cronster's Introduction

cronster

https://readthedocs.org/projects/cronster/badge/?version=latest https://travis-ci.org/florianeinfalt/cronster.svg?branch=master

Full Documentation

Installation

To install cronster, type:

$ pip install cronster

Getting Started

Install Redis

To get started with cronster, install Redis on your computer (macOS & Homebrew in this example):

$ brew install redis
$ brew services start redis

Digital Ocean has a great tutorial on how install Redis on Ubuntu.

Run the crawler

Assuming Redis is running on your machine in default configuration and you want to crawl from ~/projects, run the following command:

$ cronster_crawler -r ~/projects

The full help output explains the other options of the CLI application. It is possible to change certain parameters should Redis on a different host/port or should you want to adjust the interval between crawls:

Usage: cronster_crawler [OPTIONS]

Options:
  -r, --root TEXT           Crawling root, default: the current working directory
  -h, --cache-host TEXT     Cache host, default: localhost
  -p, --cache-port INTEGER  Cache port, default: 6379 (Redis default)
  -i, --interval INTEGER    Crawling interval, default: 2 seconds
  --help                    Show this message and exit.

Run the scheduler

Assuming Redis is running on your machine in default configuration, run the following command:

$ cronster_scheduler

The full help output explains the other options of the CLI application. It is possible to change Redis-related parameters should Redis on a different host or port:

Usage: cronster_scheduler [OPTIONS]

Options:
  -h, --cache-host TEXT     Cache host, default: localhost
  -p, --cache-port INTEGER  Cache port, default: 6379 (Redis default)
  --help                    Show this message and exit.

Write a crontab file

Write the following YAML file to ~/projects/crontab (or any other location anywhere in the hierarchy under your root location):

test_job:
    cmd: echo "Hello, World!"
    schedule: "*/5 * * * *"

You should see the job being picked up by the crawler on the next crawl and should see the scheduler run the job every five minutes.

cronster's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.