CodeGrabber
{ USER }
posts: 23
last: 28-Apr-2008
TITLE: mysql dump to another server
DESCRIPTION: mysql dump to another server
Submitted: 28-Nov-2007 04:43:48 ( 1yrs 5w 5d 23h ago ) Language: MySQL (*.sql)
Views: 165 Lines of Code: 4 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Beginner
Bookmark
// Using UNIX pipe concept one can dump database to another server securely using ssh protocol.
// All you need remote execution rights for the ‘dd’ command, over SSH.

mysqldump -u USERnAME -p'PASSWORD' YOUR-DATABASE-NAME | ssh user@remote.server.com "dd of=/mysql/$(date +'%d-%m-%y')"