Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Wednesday, April 23, 2014

New cron job

Welcome to my crontab, new cron job!

18 * * * * ps -feww | grep -v grep | grep python | wc -l | sed -e '/^[0-4]$/ d; s/$/ pythons are running/g'

Why? If you've ever run into the problem where python cron jobs start piling up because of abrtd, and you've restarted abrtd, this will help you keep an eye on things. Every hour on the 18 (so as not to run into one of my running python scripts) I'm counting python processes and if there are more than four, I'll hear about it.

Saturday, December 08, 2012

MySQLdb ≠ autocommit

Something else I've learned recently is that MySQLdb disables autocommit.

Permission and PSP Import

If you have a PSP page and you're trying to import a custom module and you get an error like this:

ImportError: No module named mymodule