Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44852

Re: python backup script

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <matt.walker.jones@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'enabling': 0.05; 'binary': 0.07; 'defaults': 0.07; 'modified': 0.07; 'see:': 0.07; 'socket': 0.07; 'indicates': 0.09; 'mixed': 0.09; 'part,': 0.09; 'replication': 0.09; 'skip:/ 10': 0.09; 'subject:script': 0.09; 'tcp/ip': 0.09; 'systems.': 0.12; 'changes': 0.15; 'windows': 0.15; "'client',": 0.16; '(default)': 0.16; '(via': 0.16; 'help?': 0.16; 'localhost': 0.16; 'locations.': 0.16; 'sockets': 0.16; 'subject:python': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'deployment': 0.19; 'file,': 0.19; 'memory': 0.22; 'example': 0.22; 'email addr:gmail.com&gt;': 0.22; 'to:name :python-list@python.org': 0.22; 'error': 0.23; '(such': 0.24; 'config': 0.24; 'entries': 0.24; 'script.': 0.24; "shouldn't": 0.24; 'url:dev': 0.24; 'mon,': 0.24; 'looks': 0.24; "i've": 0.25; 'options': 0.25; 'script': 0.25; '&gt;': 0.26; 'logging': 0.26; 'skip:" 30': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'raise': 0.29; 'unix': 0.29; "doesn't": 0.30; 'locations': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'asked': 0.31; 'code': 0.31; 'getting': 0.31; 'follows': 0.31; 'omitted': 0.31; 'option)': 0.31; 'option.': 0.31; 'username': 0.31; 'anyone': 0.31; 'file': 0.32; 'option': 0.32; 'run': 0.32; 'linux': 0.33; 'url:python': 0.33; 'running': 0.33; '(most': 0.33; 'monday,': 0.33; 'skip:# 10': 0.33; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'interaction': 0.36; 'object,': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'similar': 0.36; 'url:org': 0.36; 'server': 0.38; 'skip:& 10': 0.38; 'thank': 0.38; 'skip:[ 10': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'little': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'url:mail': 0.40; 'read': 0.60; 'new': 0.61; 'simple': 0.61; "you've": 0.63; 'information': 0.63; 'skip:n 10': 0.64; 'here': 0.66; 'between': 0.67; 'helping': 0.70; 'configparser': 0.84; 'plays': 0.84; 'want:': 0.84; 'hill': 0.95; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Io8bOKqzPf7Y2PyhTyGujfU86KwZ4FbX78IVJ8CydXM=; b=Au+hdLEgDqqfBkds89aNat7Y/jS51Hnf4/cSXjwzU6gRQwnp0vpHkajl2jYiuQfiZ8 AK+UAX8ibkZ12eazNEiAFnKIkoNaDWN/RRSIgg9DcgOSLN7X7bliK+STLuLJqxieVXoM Cru5hiIgTkUscWPy2HXqd9zlBCRuQbGoTuq3rddpNYcs4gJMaIig7zyBcfQZGVcs3BMT J9RIE9BS442GFIa8EaIjimBHplh+Wnsk4tRKk/MnJx1zt8t7z55wk8kuscsGVX8bRZ4f joiU9n86abbWNO/cLEu57g6AwVjRyXDdqQLL0ndaZHRFCfKZuJD7WBCceAVIKTc+QPqO eiTQ==
X-Received by 10.182.96.37 with SMTP id dp5mr5882624obb.93.1367874521154; Mon, 06 May 2013 14:08:41 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <489bad9e-4a96-4d51-98ea-ce59c2573e4f@googlegroups.com>
References <b586db98-78b2-40a6-9e1c-3d8b939657c8@googlegroups.com> <mailman.1371.1367867496.3114.python-list@python.org> <51f5c8c4-b40b-4a1e-b72b-905caa62aaf6@googlegroups.com> <mailman.1373.1367870074.3114.python-list@python.org> <489bad9e-4a96-4d51-98ea-ce59c2573e4f@googlegroups.com>
From Matt Jones <matt.walker.jones@gmail.com>
Date Mon, 6 May 2013 16:08:20 -0500
Subject Re: python backup script
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=001a11c2ab98ee989a04dc131abd
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1386.1367874530.3114.python-list@python.org> (permalink)
Lines 581
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367874530 news.xs4all.nl 15961 [2001:888:2000:d::a6]:50167
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44852

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Why do you have to use that file?  Why can't you copy its contents into a
new file in your working directory and make whatever changes necessary?


Example of the changes your code makes me think you want:

************************
# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock
mmz          = bleh
pass1          = blah
localhost          = bluargh


*Matt Jones*


On Mon, May 6, 2013 at 3:37 PM, MMZ <programmer.toronto@gmail.com> wrote:

> Thanks Matt.
> my.cnf is a readonly file and cannot be changed or modified but do you
> know of a file that stores similar information on CentOS?I think I'm not
> reading from a right file maybe.
>
> On Monday, May 6, 2013 3:46:04 PM UTC-4, Matt Jones wrote:
> > I've never used ConfigParser either, but shouldn't the "[client]"
> section have the options "mmz", "pass1", or "localhost" somewhere?  Do you
> need to add them to that file?
> >
> >
> >
> >
> > Matt Jones
> >
> >
> >
> > On Mon, May 6, 2013 at 2:20 PM, MMZ <programme...@gmail.com> wrote:
> >
> >
> > On Monday, May 6, 2013 3:11:33 PM UTC-4, Jerry Hill wrote:
> >
> >
> > > On Mon, May 6, 2013 at 3:01 PM, MMZ <programme...@gmail.com> wrote:
> >
> > >
> >
> > >
> >
> > >
> >
> > > I am trying to backup database on CentOS linux server,I'm getting
> error when running the following script. anyone can help?
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> >
> > > Traceback (most recent call last):
> >
> > >
> >
> > >   File "./backup.py", line 8, in ?
> >
> > >
> >
> > >     username = config.get('client', 'mmz')
> >
> > >
> >
> > >   File "/usr/lib/python2.4/ConfigParser.py", line 511, in get
> >
> > >
> >
> > >     raise NoSectionError(section)
> >
> > >
> >
> > >
> >
> > >
> >
> >
> > > I've never used ConfigParser, but that
> >
> > >
> >
> > > error message looks pretty simple to interpret.  You've set up a
> ConfigParser object, told it to read in ~/my.cnf, the asked for the value
> of section 'client', option 'mmz'.  The error indicates that your config
> files doesn't have a section named 'client'.
> >
> >
> >
> > >
> >
> > >
> >
> > >
> >
> > > What is the content of your ~/my.cnf file?
> >
> > >
> >
> > > --
> >
> > >
> >
> > >
> >
> > > Jerry
> >
> >
> >
> > Thank you for helping Jerry. Actually I found this script for debian but
> I want to use it for CentOS server so I replaced /etc/mysql/debian.cnf with
> ~/my.cnf
> >
> > the file content is:
> >
> >
> >
> >  Example MySQL config file for medium systems.
> >
> > #
> >
> > # This is for a system with little memory (32M - 64M) where MySQL plays
> >
> > # an important part, or systems up to 128M where MySQL is used together
> with
> >
> > # other programs (such as a web server)
> >
> > #
> >
> > # MySQL programs look for option files in a set of
> >
> > # locations which depend on the deployment platform.
> >
> > # You can copy this option file to one of those
> >
> > # locations. For information about these locations, see:
> >
> > # http://dev.mysql.com/doc/mysql/en/option-files.html
> >
> > #
> >
> > # In this file, you can use all long options that a program supports.
> >
> > # If you want to know which options a program supports, run the program
> >
> > # with the "--help" option.
> >
> >
> >
> > # The following options will be passed to all MySQL clients
> >
> > [client]
> >
> > #password       = your_password
> >
> > port            = 3306
> >
> > socket          = /tmp/mysql.sock
> >
> >
> >
> > # Here follows entries for some specific programs
> >
> >
> >
> > # The MySQL server
> >
> > [mysqld]
> >
> > port            = 3306
> >
> > socket          = /tmp/mysql.sock
> >
> > skip-locking
> >
> > key_buffer_size = 16M
> >
> > max_allowed_packet = 1M
> >
> > table_open_cache = 64
> >
> > sort_buffer_size = 512K
> >
> > net_buffer_length = 8K
> >
> > read_buffer_size = 256K
> >
> > read_rnd_buffer_size = 512K
> >
> > myisam_sort_buffer_size = 8M
> >
> >
> >
> > # Don't listen on a TCP/IP port at all. This can be a security
> enhancement,
> >
> > # if all processes that need to connect to mysqld run on the same host.
> >
> > # All interaction with mysqld must be made via Unix sockets or named
> pipes.
> >
> > # Note that using this option without enabling named pipes on Windows
> >
> > # (via the "enable-named-pipe" option) will render mysqld useless!
> >
> > #
> >
> > #skip-networking
> >
> >
> >
> > # Replication Master Server (default)
> >
> > # binary logging is required for replication
> >
> > log-bin=mysql-bin
> >
> >
> >
> > # binary logging format - mixed recommended
> >
> > binlog_format=mixed
> >
> >
> >
> > # required unique id between 1 and 2^32 - 1
> >
> > # defaults to 1 if master-host is not set
> >
> > # but will not function as a master if omitted
> >
> > server-id       = 1
> >
> > --
> >
> > http://mail.python.org/mailman/listinfo/python-list
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 12:01 -0700
  Re: python backup script Jerry Hill <malaclypse2@gmail.com> - 2013-05-06 15:11 -0400
    Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 12:20 -0700
      Re: python backup script Matt Jones <matt.walker.jones@gmail.com> - 2013-05-06 14:46 -0500
        Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 13:37 -0700
          Re: python backup script Matt Jones <matt.walker.jones@gmail.com> - 2013-05-06 16:08 -0500
  Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-06 23:44 +0200
    Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-06 23:48 +0200
      Re: python backup script mina@socialassets.org - 2013-05-06 15:12 -0700
        Re: python backup script John Gordon <gordon@panix.com> - 2013-05-06 22:15 +0000
          Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-07 21:11 +0200
        Re: python backup script MRAB <python@mrabarnett.plus.com> - 2013-05-06 23:28 +0100
      Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 15:15 -0700
  Re: python backup script Chris Angelico <rosuav@gmail.com> - 2013-05-07 08:12 +1000
    Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 15:40 -0700
      Re: python backup script Chris Angelico <rosuav@gmail.com> - 2013-05-07 08:51 +1000
      Re: python backup script MRAB <python@mrabarnett.plus.com> - 2013-05-06 23:52 +0100
  Re: python backup script Peter Otten <__peter__@web.de> - 2013-05-07 08:18 +0200

csiph-web