LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-08-2007, 03:28 PM   #1
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, Fedora
Posts: 415

Rep: Reputation: 31
Question mysqldump to a remote machine


We have a LAMP server located in another floor. We are able to do backup using this command:

mysqldump -u <user> -P<password> <database> > <targetfile.sql>

the backup file <targetfile.sql> creates fine at the localhost machine, but let say I wanted to copy or move or create the targetfile.sql to another remote machine. I not too familar with the steps to be taken in this case. I have seen the scp command, but still have not tested it. Help is greatly appreciated. Thanks!
 
Old 03-08-2007, 03:44 PM   #2
cgjones
Member
 
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
To copy your db dump file to a remote server, the scp command would look something like this.
Code:
scp targetfile.sql remoteserver:/path/to/directory/
Check out the man page for scp for more detailed instructions.
 
Old 03-09-2007, 11:23 AM   #3
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, Fedora
Posts: 415

Original Poster
Rep: Reputation: 31
Will this work in a cronjob? Do I need to enter user/pass for the remoteserver?

Thanks..
 
Old 03-09-2007, 12:17 PM   #4
cgjones
Member
 
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
If you have passphrase-less public key authentication setup between the local and remote computers it should work just fine. Check out the OpenSSH website for more information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 12:21 AM
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 12:23 PM
Complicated one: MySQL, rsync, remote machine, local machine daiver Linux - General 2 02-27-2006 12:14 PM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 07:39 PM
using linux to redirect remote vpn traffic to another remote machine brb5548 Linux - Networking 0 06-28-2003 09:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration