# Backup - "Dump over SCP" like



## josefernando (Oct 26, 2012)

Hello guys,

I need to backup a system. I'm using dump to do this, but the backup need to be sent to a remote server. Its something like this:


I need to backup server1
The backup will be storaged on server2
server1 can't access server2, but server2 can access server1

I was thinking something like this:

On server2:
`# scp server1:"dump command" /backup/ad0.dump`

Can someone help me?

PS: Sorry for my bad English.


----------



## wblock@ (Oct 27, 2012)

Difficulty: for full access, the user running dump(8) needs to be root, or at least have a lot of access rights.  root login over ssh(1) is usually disabled, and for good reason.

The backup would have to run ssh on the receiving machine also.


----------



## oed (Oct 28, 2012)

How about this: Add the backup user on server1 to group operator. Then you can run a command like this on server2:
`# ssh backupuser@server1 dump 0uaLf - /filesystemtodump | dd of=backupfile.dump`


----------



## josefernando (Oct 29, 2012)

The backup must be stored directly on server2, i can not be stored on server1 then moved to server2.

My ideia of the command was: the output of the "dump command"(executed on server1) would be stored on the local file /backup/ad0.dump(on server2)


----------



## bbzz (Oct 29, 2012)

`# dump -0uaLf - FS_TO_DUMP | ssh user@server2 dd of=/place/to/dump/my.dump`


----------



## josefernando (Oct 29, 2012)

bbzz said:
			
		

> `# dump -0uaLf - FS_TO_DUMP | ssh user@server2 dd of=/place/to/dump/my.dump`



Server1 cant initiate the communication, i have a firewall blocking it. =/


----------



## bbzz (Oct 29, 2012)

Missed the point #3, sorry. I guess you could pull with ssh as well, just set up public key authentication for root account.


----------



## oed (Oct 29, 2012)

josefernando said:
			
		

> The backup must be stored directly on server2, i can not be stored on server1 then moved to server2.
> 
> My ideia of the command was: the output of the "dump command"(executed on server1) would be stored on the local file /backup/ad0.dump(on server2)



Please re-read post #3.

`# ssh backupuser@server1 dump 0uaLf - /filesystemtodump | dd of=backupfile.dump`

On server2 you use ssh to execute dump on server1. The option "-f -" is used to specify that the output will be sent to stdout, which will be sent through your ssh connection back to server2. Then the output from the ssh connection on server2 is piped to the dd command (executed on server2). How is that solution not working out for you?


----------



## josefernando (Oct 29, 2012)

Wow, my bad. When I saw it, I thought it would store the backup file on server 2. I'm testing it on my lab now, and it seems to be working.


----------

