Giter VIP home page Giter VIP logo

chkcrontab's People

Contributors

gurgeous avatar lyda avatar nekoya avatar pmac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chkcrontab's Issues

RPM spec file

This was the other remaining issue from code.google: want an rpm spec file.

It's been a long time since I've made an rpm spec file but I can give it a go. Should be easy enough to get a fedora docker image. I'll see what other python projects do for packaging files.

quiet option too quiet

It would be great if there was a quiet option that would emit nothing if no error or warnings were found, but would emit the warning or error if one is found.

Use case is to have chkcrontab running from a file in /etc/cron.d on a regular basis so any errors that slipped in will be picked up and emailed to root.

so a cron entry like:

5 * * * * root for i in /etc/cron.d/*; do /usr/local/bin/chkcrontab -q $i ; done

would only email the user if an error was detected.

Modify filename acceptance criteria with flags.

The Debian packaging standard has rules on acceptable filenames for files destined to cron.d. Enabling these with a flag would be better than the current solution.

http://www.debian.org/doc/manuals/maint-guide/dother.en.html#crond

When checking files in a package's debian/ directory, filenames should only match the (\S+\.)?cron.d as opposed to the other names currently accepted. In addition the error for this should probably point the user at the above link.

I suspect other packaging systems have their own standards, so need to investigate those first.

chkcrontab command takes nonexistent file without complaints and exits okay (exitcode=0)

As seen below, randomly typing a nonexistent filename chkcrontab would take it in fine with no complaints and gives an okay exist code (0).

$ ls -l
total 16
-rw-r--r--  1 ye  staff   120 Nov  7 18:04 Dockerfile
-rw-r--r--  1 ye  staff  2145 Nov  8 11:02 test-crontab
$ chkcrontab ./8e5f63ef-915b-4616-ad90-31a1a590922d
Checking correctness of ./8e5f63ef-915b-4616-ad90-31a1a590922d
$ echo $?
0
$ chkcrontab 
ERROR: No crontab file was specified.
$ echo $?
1

It should probably exit with an error exitcode(1) and print out an error message just as if I didn't provide a file or similar. "ERROR: ./8e5f63ef-915b-4616-ad90-31a1a590922d doesn't exist."

Add a -v/--version flag

It would be nice to have a version flag. And generally setting the version in a sane way would be nice - preferably via git describe so I don't screw up version names in future pypi uploads...

check permissions on file

I just encountered a case where the cron file is valid, but the permissions on the file allowed write by "other". A chmod o-w file fixed it, and chkcrontab did not capture this as I assume it doesn't check the file permissions. When the cron service started, it was not processing the file, throwing an error in /var/log/syslog: ffamfe_da_cron_1 | Jan 18 12:16:01 ffa24 cron[1084]: (*system*ffamfe_da) INSECURE MODE (group/other writable) (/etc/cron.d/ffamfe_da)

Make user field optional

Many crontab files are written without a user. Can we have a flag for this. I do not mind if it disables optional user by default, but would very much appreciate if there exists an option to do so.

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.