--- created by sagar shirsath (sagars@weboniselab.com)--- | |
the file pydump contains python code for taking sql dump . | |
How to run : | |
Go to folder containing file pydump and run the following command | |
$python pydump.py | |
#!/usr/bin/env python | |
import ConfigParser | |
import os | |
import time | |
import getpass | |
def get_dump(): | |
print "Enter user:" | |
user = raw_input() | |
print "Password will not be visible:" | |
password = getpass.getpass() | |
print "Enter host:" | |
host = raw_input() | |
print "Enter database name:" | |
database = raw_input() | |
filestamp = time.strftime('%Y-%m-%d-%I:%M') | |
os.popen("mysqldump -u %s -p%s -h %s -e --opt -c %s | gzip -c > %s.gz" % (user,password,host,database,database+"_"+filestamp)) | |
print "\n-- please have a the dump file in "+database+"_"+filestamp+".gz --" | |
if __name__=="__main__": | |
get_dump() | |
This comment has been minimized.
This comment has been minimized.
If the folder output is unspecified Python is smart enough to put it in the current working directory meaning youll have the dump in the same place as you store this file. |
This comment has been minimized.
This comment has been minimized.
Hey there, Thanks for your effort. |
This comment has been minimized.
This comment has been minimized.
Hi Team,
|
This comment has been minimized.
This comment has been minimized.
given link is not working(404) |
This comment has been minimized.
This comment has been minimized.
yes @gurutux can you check the link |
This comment has been minimized.
This comment has been minimized.
Just go to his profile, it's there. |
This comment has been minimized.
where's the folder for ouput file? is the same with pydump?