Git Product home page Git Product logo

eyc's Introduction

EYC

Extending cronjob starting from a single or few cronjobs

EYC is an acronym which stands for Enlarge Your Cron. It is a script manager that extends your cronjobs: you invoke a single script and it wraps and launch all the scripts you want.


It works like this:

*|**A cronjob is called e.g. every 15 min
 |
 |___eyc.sh -f fifteen <-- wrapper is called to look for "15mins" scripts
    |
    |__fifteen/ <-- it looks in the right dir
      |__scriptA.sh <--\
      |__scriptB.sh <-- - all the script inside are executed
      |__scriptC.sh <--/

When cronjobs are limited on certain hosting, like adding only 5 cronjob commands thrhough a web panel, you probably have a pain in the neck; like us! :) Anyway if you are in an unix environement and you can use your cronjobs to execute files in a directory you owns, than there are a number of workaround. This is an exemple, written in BASH. It is soooo simple, but here are the basics:

  • go to your cronjob panel and set up a few of them like

    */15 * * * * /bin/bash /path/to/script/eyc.sh -f fifteen
    */5 * * * * /bin/bash /path/to/script/eyc.sh -f five
    0 0 * * * /bin/bash /path/to/script/eyc.sh -f daily
    5 0 1 * * /bin/bash /path/to/script/eyc.sh -f monthly
  • put your scripts inside the right directory; the where is self explanatory due to dir names :). We have a daily example script HelloWorld.sh inside ./daily/. The name of the script is not important at all, but, please, put the .sh extension in front of them!

  • while the -f fifteen cronjob is invoked, our script will search for .sh in the fifteen dir, will execute them in order, will avoid to run them twice at the same time thanks to pidfile; pidfiles are removed when their script will be ended by a cathcable SIG. If a pidfile remains orphan of its process, something went wrong, so we won't execute the script and we'll log the error in ./eyc.log file.

At the moment errors are not mailed out.

####### keywords bash cron cronjob fake handler script manager cli linux cron.d

eyc's People

Contributors

alessandro-fazzi avatar

Watchers

 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.