{ "info": { "author": "Matthias Kauer", "author_email": "mk.software@zuez.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python" ], "description": "[![build status](https://travis-ci.org/MatthiasKauer/croncoat.png?branch=master)](https://travis-ci.org/MatthiasKauer/croncoat)\n\ncroncoat\n========\n\ncroncoat extends [cronwrap](https://github.com/Doist/cronwrap), a cron job wrapper that wraps jobs and enables better error reporting and command timeouts.\nMajor differences between the two are:\n\n* croncoat relies on python email and smtplib libraries (configuration easier if system mailer not setup yet); cronwrap uses the system mailer ```mail``` (configuration more invovled, but maybe already done).\n(Note: I started here because I wanted to alter the email from address and the syntax for command-line mail differed between different Linux flavors that I tested.)\n* croncoat kills commands if they take longer than the allotted timeout; cronwrap waits (potentially forever) and alerts only a posteriori. **croncoat thus calls commands without full shell.** Some commands may therefore not work although I'm currently only aware of non-relevant examples like ```croncoat -c 'exit(1)'```\n* Subject line have been improved to be more helpful in croncoat and there are some other minor formatting improvements.\n* Cronwrap is running reliably for many (I suppose) people for many years. Croncoat is new and must be observed more carefully.\n\nKnown Issues\n===========\n\n* Choosing small times (e.g. -t 3s) won't work b/c the alarm signal will trigger while the smtp server is still being contacted.\n* stdout is currently not captured if the command is killed due to timeout.\n\nInstalling\n===========\n**Read path issues below for use in crontab!**\n\n### Pypi\ncroncoat is on PyPI: https://pypi.python.org/pypi/croncoat\n\nInstall via:\n```\npip install croncoat\n```\n\n### Git installation\nTo install the bleeding-edge version :\n\n $ git clone \n $ sudo python setup.py install\n\n### Path issues in crontab\nWARNING: On my system croncoat wasn't in the shorter path that cron uses during execution. This is very confusing b/c everything works outside cron, but once that comes into play nothing runs anymore. You need to add a line like the following to crontab before the scripts you want to execute.\n\n```\nPATH=/usr/local/bin:/usr/bin:/bin\n```\n\nAlternatively, you can prefix ```/usr/local/bin/croncoat``` instead of just ```croncoat``` in crontab of course.\n\nExample usage\n===========\n\n```\nusage: croncoat [-h] [-c CMD] [-e EMAILS] [-t TIME] [--print-ini [PRINT_INI]]\n [--config CONFIG] [-v [VERBOSE]]\n\nWrap cron jobs for better error email error reporting with command timeouts.\nVersion 0.3\nYou must create a config file (~/.croncoat.ini by default) to store smtp server data.\nIdeally this would be readable only by you.\nTo output a config skeleton, use croncoat --print-ini\n\nUsage examples:\n===============\nSend test email:\ncroncoat -e test@domain.org\n\nSend email after killing a script that takes longer than 5s\ncroncoat -t 5s -c 'sleep 10s' -e test@domain.org\n\nPrint to stdout after catching error in script;\nNote: this won't work with exit(1) b/c no real shell here\ncroncoat -c 'python -c import sys; sys.exit(1)'\n\nPrint no output for successful command\ncroncoat -c 'ls -la'\nPrint output of successful command\ncroncoat -v -c 'ls -la'\n\noptional arguments:\n -h, --help show this help message and exit\n -c CMD, --cmd CMD Run a command. Could be `croncoat -c \"ls -la\"`. No command => test email is sent.\n -e EMAILS, --emails EMAILS\n Send email to the following addresses if the command crashes or exceeds timeout. Uses Python's email library to send emails (therefore no user namesunlike original cronwrap). If this is not set, only output to stdout.\n -t TIME, --time TIME Set the maximum running time. If this time is reached, the script will be killed and an alert email will be sent. If the script is killed stdout/stderr cannot be captured at this time! The default is 1 hour `-t 1h`. Possible values include: `-t 2h`,`-t 5m`, `-t 30s`.\n --print-ini [PRINT_INI], --print-config [PRINT_INI]\n Print the configuration file format. This can be redirected to a file name to have a config skeleton.\n --config CONFIG, --ini CONFIG, -i CONFIG\n use an .ini file with custom name and path (not the default .croncoat.ini in users' home directory\n -v [VERBOSE], --verbose [VERBOSE]\n Will send an email / print to stdout even on successful run.\n```\n\nDevelopment tips\n=============\n\n## Virtualenv setup\nCreate virtual environment w/o site-packages. We don't need \"complicated\" packages for this project.\n```\nvirtualenv --no-site-packages venv #only required once; excluding site packages is default now mostly\nsource venv/bin/activate #activate venv\nwhich pip #double-check\npip install -r requirements.txt # install required packages\n```\n\n## Running tests\n```\npy.test croncoat\ncram test-cram\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MatthiasKauer/croncoat", "keywords": "cron wrapper crontab cronjob email", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "croncoat", "package_url": "https://pypi.org/project/croncoat/", "platform": "Unix", "project_url": "https://pypi.org/project/croncoat/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/MatthiasKauer/croncoat" }, "release_url": "https://pypi.org/project/croncoat/0.4/", "requires_dist": null, "requires_python": null, "summary": "croncoat extends cronwrap, a cron job wrapper that wraps jobs and enables better error reporting and command timeouts.", "version": "0.4" }, "last_serial": 2939990, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "452742e1e7debba514dd22eccb461c68", "sha256": "334d5f2957703a5a533f4bb9e772185b3568a9eea4e126bc1776bff1388e68ad" }, "downloads": -1, "filename": "croncoat-0.3.tar.gz", "has_sig": false, "md5_digest": "452742e1e7debba514dd22eccb461c68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10106, "upload_time": "2015-09-13T02:49:26", "url": "https://files.pythonhosted.org/packages/c8/64/ca8ee5dd517f7447326b3574f84fbd9dc969fb44d145fc0772c17cb350a4/croncoat-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a084581658d70f521e2d22cb81615d22", "sha256": "56ce01063361e1f6fc047e57f90975e226676462ca7e789d2d297e08223e257b" }, "downloads": -1, "filename": "croncoat-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a084581658d70f521e2d22cb81615d22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10538, "upload_time": "2015-09-13T05:50:36", "url": "https://files.pythonhosted.org/packages/1f/10/4f8f0d39d8a4d2e6ac876c4b505b116438b43884378770f6b03e12309596/croncoat-0.3.1.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "89f66cb1ec00e22989cc63777395fcfd", "sha256": "4d5936e33fefc6dd2a2f3d4fcfd3fbc1803311834e7fda3970a7c01334cc959d" }, "downloads": -1, "filename": "croncoat-0.4.tar.gz", "has_sig": false, "md5_digest": "89f66cb1ec00e22989cc63777395fcfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8445, "upload_time": "2017-06-10T06:24:14", "url": "https://files.pythonhosted.org/packages/ee/cf/ac516055aee405bac15953d44e7b763379ab74adda5402499d44d13e01bd/croncoat-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "89f66cb1ec00e22989cc63777395fcfd", "sha256": "4d5936e33fefc6dd2a2f3d4fcfd3fbc1803311834e7fda3970a7c01334cc959d" }, "downloads": -1, "filename": "croncoat-0.4.tar.gz", "has_sig": false, "md5_digest": "89f66cb1ec00e22989cc63777395fcfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8445, "upload_time": "2017-06-10T06:24:14", "url": "https://files.pythonhosted.org/packages/ee/cf/ac516055aee405bac15953d44e7b763379ab74adda5402499d44d13e01bd/croncoat-0.4.tar.gz" } ] }