If someone could not understand what exactly i’m trying to do, here it goes….
I use amazon cloud server, so i want to backup my database with a python script, hopefully i’ve got it working from command line…..
When i do a backup, it should run mysqldump on amazon server and save it into amazon server itself!! /home/abhilash/dumps/
So how do i use this command in python?? I’m new to python and trying this for a while…
mysqldump -h 50.12.xx.xx nameofdb -u root -p |gzip -9 | ssh abhilash@50.12.xx.xx "gzip -d>/home/abhilash/a.dump"
I want to use the above command in python, whats the easiest way?? thanks!!
Maybe you should take a look at fabric
It may be overkill for a single command, but as soon as your deployment/backup tasks become complex, it will surely pay off.
There are a lot of good example fabfiles to learn from on github.
To use fabric in conjunction with mysqldump see these blog posts: