manage your cron jobs with python and a revision system(CLI)
Project description
python-cron-migration
python-cron-migration is a CLI package that was built for helping you manage your cronjobs by revisions files system. It contains two main components:
- a CLI revision system, which can generate/upgrade/downgrade revision files by simple commands.
- a lightweight crontab high-level package which integrates with the
crontab
library on your OS
commands
entry point | command | example | description |
---|---|---|---|
cronmig | init | cronmig init | initializes a new environment |
cronming-revision | make | cronmig-revision make [filename] |
generates a new revision file . [filename] should be a short description of your revision file |
cronming-revision | upgrade | cronmig-revision upgrade | upgrades all non-upgraded files by invoking the upgrade method within your revision file |
cronming-revision | downgrade | cronmig-revision downgrade [steps] |
downgrades revisions files [steps] times. [steps] is the number of downgrading (from the most upgraded file) |
System requirements
- unix OS
- crontab installed on your machine
Installation
pip
pip install itay-bardugo-cron-migration -U
Usage
Basic Usage
- init a new environment
cd
to your desired path- run
cronmig init
. - this command composes a new
cronjobs
folder with all needed files. - its recommended to run this command from your top root folder.
-
+-- project (-> you are here) | +-- unittest | +-- project | +-- systemfile.py
- upload
cronjobs/revisions
folder to git. (do not upload any other file.)
- generate a new revision file
cd
to the path wherecronjobs
was installed (do notcd
intocronjobs
folder)- run
cronmig-revision make [replace-with-short-description]
- this commands generates a new revision file
- add this file to GIT or any other VCS (important)
- upgrade
cd
to the path wherecronjobs
was installed (do notcd
intocronjobs
folder)- run
cronmig-revision upgrade
Branching
when you make a new branch from a repo, you should tell python-cron-migration
to start a new revision file, which represents the
beginning of your changes of the current branching (because all revision files from all branches are are exist within the "master" repo)
in order to separate non-relevant revision files from your changes.
to make it happen, just add -h
flag to the cronmig-revision make [message]
command.
it looks like this:
cronmig-revision make -h "my new revision head file"
it creates a new revision file, but with no reference to the last revision file.
Testing
cd unittest
python application.py ApplicationTest.test_app
Security
If you discover any security related issues, please email itaybardugo91@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for itay_bardugo_cron_migration-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0993be94ba0479e89840a070e053e465947361639b2855050964ce5626af1447 |
|
MD5 | 53d760cc7c6e8d2b69183be56eb4db7e |
|
BLAKE2b-256 | 078e9e2e69bbecd0b4c2b6a84e188ac6fe1473253a1278af16e30a7b6b584d8e |