Kryze / pybatch

Gestion de Processus en Batch (Python)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pybatch

A Python cron-like tool to schedule execution of commands.

What is Pybatch ?


Pybatch is a program who let you schedule execution of a command when you want.

It's a school project for a M1 MIAGE course.

Installation


This project only works for UNIX systems because of the use of semaphore and for the meaning of the course.

First, you need to install posix_ipc by running :

pip install posix_ipc

Download both python script (gobatch.py & pybatch.py) and put them in a directory of your choice.

You need to run gobatch.py by running ./gobatch which is the server of your commands.

You will then enter commands with pybatch.py

How works Pybatch ?


Each time you want to enter a command, a file named fbatch.txt

There are 3 parameters available :

./pgcycl -a minute hour monthday month weekday command output error

You can choose the interval of execution of your commands by choosing which parameters you want to fill. Here is the interval of each value :

  • minute 0-59
  • hour 0-23
  • monthday 1-31
  • month 1-12
  • weekday 0-6
  • output (The file of the standard output)
  • error (The file of the error output)

You can also put "*" to replace an empty time/date field or just let the rest of the time/date field empty.

You must choose a command and an output/error parameter.

A command can take space by putting "''" between the parameter.

./pgcycl -l

This command let you list the differents commands you are running in a cycle.

./pgcycl -d x

This command let you delete an execution of command by choosing the line of the command you want to delete.

You can view each line with ./pgcycl -l

Contributors


Laurene Cladt

Rodolphe Aubry

Benjamin "Kryze"

About

Gestion de Processus en Batch (Python)

License:GNU General Public License v3.0


Languages

Language:Python 100.0%