Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 servers. 1 is main. 2 is backup. I would like 2 to log in and grab files from 1 and backup on 2 with rsnapshot. Is this possible?

I was looking at the config setup and saw this:

backup_script  ssh root@example.com "mysqldump -A > /var/db/dump/mysql.sql"    unused2

That means that it will log into a server via SSH (not sure how to pass a password or key file) and copy/dump mysql into the directory unused2

EDIT: After further research, I believe this is what I'll want right? This will dial into the remote server and copy files over? Still not sure how to load a password or key in yet

backup_script scp username@server:/home homebackup
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Use:

ssh -i /path/to/key/file user@server
scp -i /path/to/key/file file user@server:/remote/location
share|improve this answer
    
With SCP you are connecting to a remote connection and copying files to your local connection, right? –  Tiffany Walker Nov 26 '12 at 18:49
    
No, with scp you are copying file to the remote server, to do the revers: scp -i /path/to/key/file user@server:/remote/location /local/location –  melsayed Nov 27 '12 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.