Monday 31 December 2012

Install required python packages for OpenERP v 7.0

To install OpenERP v7 on linux machine you required various python library. Run below command, it includes all python libraries in only one line.
sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-psutil

Friday 28 December 2012

Python script to backup all database

list all the database from the  postgresql server, 
run the query in postgresql 

psql SELECT datname FROM pg_database;

it will list all the database from the postgres server. copy and paste it in one text file. and run the script.

import os

lines = [line.strip() for line in open('<<path to file>>')]
for i in lines:
    print os.system("pg_dump %s >
<<path to file>>%s.out" % (i,i))

it will dump all the database in particulate folder