Skip to main content

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:

  1. a CLI revision system, which can generate/upgrade/downgrade revision files by simple commands.
  2. 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

  1. unix OS
  2. crontab installed on your machine

Installation

pip

pip install itay-bardugo-cron-migration -U

Usage

Basic Usage

  1. init a new environment
    1. cd to your desired path
    2. run cronmig init.
    3. this command composes a new cronjobs folder with all needed files.
    4. its recommended to run this command from your top root folder.
    5. +-- project (-> you are here)
      |   +-- unittest
      |   +-- project
      |       +-- systemfile.py
      
    6. uploadcronjobs folder to git, except .json and .rvsn files (its ok if it doest not exist, the engine generates it later)
  2. generate a new revision file
    1. cd to the path where cronjobs was installed (do not cd into cronjobs folder)
    2. run cronmig-revision make [replace-with-short-description]
    3. this commands generates a new revision file
    4. add this file to GIT or any other VCS (important)
  3. upgrade
    1. cd to the path where cronjobs was installed (do not cd into cronjobs folder)
    2. run cronmig-revision upgrade

Branching

Once you create a new branch, you should tell python-cron-migration to start a new revision file, which represents the beginning of your changes of the current branch (because all of the revision files from all branches are exist within the "master" repo) in order to separate non-relevant revision files and treat it like it was the first revision file that was ever made. In oredr to make it happen, just use the -h(short of "head") flag when running cronmig-revision make [message] command.

Actually it looks like this:

cronmig-revision make -h "my new revision head file"

it creates a new revision file, but with no reference to any previous 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itay-bardugo-cron-migration-1.1.36.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

itay_bardugo_cron_migration-1.1.36-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file itay-bardugo-cron-migration-1.1.36.tar.gz.

File metadata

  • Download URL: itay-bardugo-cron-migration-1.1.36.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for itay-bardugo-cron-migration-1.1.36.tar.gz
Algorithm Hash digest
SHA256 a23fb73b45a0e932e289d98752dff651119f8ddc886f852f88e4a259e3870a46
MD5 cc21230402a9fff307619a4c2ab32a06
BLAKE2b-256 bd771210a2bf0970efebd5bac29c77f6909fc9f709637ffdb163b2b2e903719b

See more details on using hashes here.

File details

Details for the file itay_bardugo_cron_migration-1.1.36-py3-none-any.whl.

File metadata

  • Download URL: itay_bardugo_cron_migration-1.1.36-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for itay_bardugo_cron_migration-1.1.36-py3-none-any.whl
Algorithm Hash digest
SHA256 41d3fa693a6448509819535d607493a374fbd36eb34bb933536d159bfd97caba
MD5 7248619c76af1abadd42ae1efbd6091a
BLAKE2b-256 daa97244b2e1d710255cdb553e1da5ee525d2c6e5ed9bdc718dcfed7027c9c1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page