Making a DB Backup and send it to another server
At this time I need to make a sh script to make a db backup an send it to another server.
Thinking about this, I think I have to:
1.- Make a connection beetween the servers without password
2.- The scrip must to do:
a.- Make the mysqldump
b.- Put it in a gzip file
c.- Send througth scp the gzip file and ONLY when the copy has done the script have to delete the files that are 3 days old.
Could you help me with this?
Do you consider that is a good idea or you have a better one?
Thanks in advance.