LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Automating a restore with backuppc (https://www.linuxquestions.org/questions/linux-server-73/automating-a-restore-with-backuppc-859268/)

luchonat 01-28-2011 11:57 AM

Automating a restore with backuppc
 
People! First of all, excuse my english, I'm from Argentina.

Well, here is the thing. I've deployed BackupPC in a server at work, and everything is working fine.

Now, what I need to do this thing.

I have a remote server with a website and a postgres db running. I've been able to set up everything to be backed up using rsync. But I would like to make the same process to restore the backup immediately in a local server trough rsync, that has to be ready just in case of failure of the remote server. What I've tried to do is to run the DumpPostUserCmd, so whenever a dump is performed in the remote server, I can have my local server updated. What I've find out is that when you perform a restore through the web interface, the command that performs it is (using ps ax in the backuppc server):

/usr/bin/ssh -q -x -l root myserver.wheretodotherestore.mydomain /usr/bin/rsync --server --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --relative --ignore-times --recursive . /path/to/restore

So, what I could find out is:

/usr/bin/rsync is the command that the process runs in the server where I want to put the restore. Then the options, and finally, source and destination of the restoration. But, as you can see, the source is '.' but I cannot guess where to point that!!! So, any suggestions? Thanks a lot people!

Andy Alt 01-31-2011 12:51 AM

Well, a dot often represents your present working directory, or the working directory a program was executed from.

But it seems like if you are the one who scheduled the backups, you would know the source of your backup, if you're going to restore them to target.

Whatever the target directory you back them up to, that would be the source for restore.

Maybe some more details would help; perhaps something got lost in translation.

luchonat 01-31-2011 08:08 AM

Thanks Andy for your answer!

Quote:

Originally Posted by Andy Alkaline (Post 4243068)
Well, a dot often represents your present working directory, or the working directory a program was executed from.

But it seems like if you are the one who scheduled the backups, you would know the source of your backup, if you're going to restore them to target.

Whatever the target directory you back them up to, that would be the source for restore.

Maybe some more details would help; perhaps something got lost in translation.

Let's see the command again (this command is executed from the backuppc server):

/usr/bin/ssh -q -x -l root myserver.wheretodotherestore.mydomain /usr/bin/rsync --server --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --relative --ignore-times --recursive . /path/to/restore

So the red part, is used to log in into the remote server, where I want the folders to be restored. Then, the blue part shows what is executed in the remote server, the command rsync with the options, the source and the destination, with the source being '.' and the destination, '/path/to/restore'. This command is the one that is executed when you make a restore from the web(cgi) interface.

I know that '.' means current path. But in this case, does it refer to the current path of the local or the remote server? I've been digging into the backuppc code, but coud not find anything usefull.

Well, thanks again Andy!


All times are GMT -5. The time now is 02:58 PM.