Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 "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
up vote 0 down vote accepted


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


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.