0

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
Tiffany Walker
  • 6,681
  • 14
  • 56
  • 82

1 Answers1

0

Use:

ssh -i /path/to/key/file user@server
scp -i /path/to/key/file file user@server:/remote/location
melsayed
  • 1,122
  • 1
  • 6
  • 12
  • 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