[Tutor] Zipping files and Mysql

2011-06-27 Thread gagnrath
I am trying to write a script that will dump a mysql db and then zip the file.


I do know about mysqldb, but I was wondering if there is anything native to the 
libraries that will allow me to do this without using a seperate piece.   Then 
after I gather the DBs, I need to zip them.   I wrote the following, but wanted 
to know if I am heading in the correct direction.

zipfile.zipfile(/myfiles/my_db/, w, zip_stored)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Zipping files and Mysql

2011-06-28 Thread gagnrath
First time trying to use it, so I don't expect it to work.   Got to see if I 
have a file i don't mind playing around with to see if I can zip it up using 
the zipfile.

As for the MySQL, I think I may have to resign myself to using an alternate 
method than the straight python libraries.


Jun 28, 2011 04:02:48 AM, timomli...@gmail.com wrote:

===

On 27-06-11 21:45, gagnr...@verizon.net wrote:
> I am trying to write a script that will dump a mysql db and then zip the file.
>
>
> I do know about mysqldb, but I was wondering if there is anything native to 
> the libraries that will allow me to do this without using a seperate piece.   
> Then after I gather the DBs, I need to zip them.   I wrote the following, but 
> wanted to know if I am heading in the correct direction.
>
> zipfile.zipfile(/myfiles/my_db/, w, zip_stored)
Well, for what it's worth, I'm using the zipfile module as well in one 
of my projects to make a backup of the user's configuration directory. 
Which works pretty good.

Do have a good look though at the documentation or find some examples 
through your search engine, because the above line won't work at all.

Cheers,
Timo

> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Copying Files

2011-06-30 Thread gagnrath
I was using glob and shutil to copy logs from one location to another 
successfully, however, I have run into a snag when trying to copy a directory.  
 Not sure how to fix this.

Current Code is as follows:


for file in glob.glob("/drbd1/monitorcenter/Apps/WEB-INF/*"):   #This line is 
holding up the script due to copying a directory and not a single file
shutil.copy(file, path_2_b_2)

Any ideas?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor