Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30138
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Need to archive a MySQL database using a python script |
| Date | 2012-09-25 21:04 -0400 |
| Organization | > Bestiaria Support Staff < |
| References | <3dce14bc-cdec-4bcb-a41d-d5de1ef10bf6@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1389.1348621440.27098.python-list@python.org> (permalink) |
On Tue, 25 Sep 2012 16:17:24 -0700 (PDT), bruceg113355@gmail.com
declaimed the following in gmane.comp.python.general:
> Python Users Group,
>
> I need to archive a MySQL database using a python script.
> I found a good example at: https://gist.github.com/3175221
>
> The following line executes however, the archive file is empty.
>
> os.popen("mysqldump -u %s -p%s -h %s -e --opt -c %s | gzip -c > %s.gz" %
> (user,password,host,database,database+"_"+filestamp))
Well, First start might be to update from the old os.popen to
subprocess.Popen
Then I'd suggest working in pieces... Don't do the pipe/gzip part,
just see if the dump is creating a file first.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Need to archive a MySQL database using a python script bruceg113355@gmail.com - 2012-09-25 16:17 -0700 Re: Need to archive a MySQL database using a python script Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-25 21:04 -0400 Re: Need to archive a MySQL database using a python script Hans Mulder <hansmu@xs4all.nl> - 2012-09-26 13:50 +0200
csiph-web