View Full Version : Automated Backups With rdiff-backup
Hans
10th April 2006, 22:36
At this time i try to setup rdiff according "Automated Backups With rdiff-backup" at URL http://www.howtoforge.com/linux_rdiff_backup
After the command:
ssh-copy-id -i ~/.ssh/id_rsa.pub root@server1.example.com
An error occurs:
21
/usr/bin/ssh-copy-id: ERROR: No identities found
And i do not understand why...
Anyone knows what could be wrong?
Hans
falko
11th April 2006, 16:09
Did you follow the tutorial to the letter? Maybe you made a typo somewhere.
Hans
11th April 2006, 17:10
Both servers are Debian servers.
STEP 1:
On the backup-server (backup.mydomain.tld) I gave the command:
apt-get install rdiff-backup
On the webserver (server1.mydomain.tld) I gave the command:
apt-get install rdiff-backup
STEP 2:
On backup.mydomain.tld I gave all the commands following from now on:
groupadd -g 3500 rdiff-backup
useradd -u 3500 -s /bin/false -d /backup -m -c "rdiff-backup" -g rdiff-backup rdiff-backup
su -m rdiff-backup
cd /backup
ssh-keygen -t rsa
I gave two times an <enter> according the How to.
I created the file /backup/.ssh/config using the command $ nano /backup/.ssh/config with this contents:
host server1_backup
hostname server1.mydomain.tld
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2
When I wanted to save this file I got a message in the nano editor, that I have no permission to save the file. I decided to switch to root, by giving the command su and gave the root’s password.
Now the file /backup/.ssh/config was created with the contents mentioned above.
Now I gave the command: chmod -R go-rwx /backup/.ssh
And finally the command:
ssh-copy-id -i ~/.ssh/id_rsa.pub root@server1.mydomain.tld
Then I receive the error on backup.mydomain.tld
21
/usr/bin/ssh-copy-id: ERROR: No identities found
Maybe I did something wrong, but I don’t think that I make a mistake by typing as I use Putty.
Cut and paste is not that difficult.
Can you help me further with this information?
Hans
falko
11th April 2006, 19:31
When I wanted to save this file I got a message in the nano editor, that I have no permission to save the file. I decided to switch to root, by giving the command su and gave the root’s password.
You must be root during the whole tutorial!
Hans
11th April 2006, 21:36
I am a little further now but i did not succeed.
After these next two commands (at the end to test the backup) an error occurs:
cd /backup
rdiff-backup server1_backup::/boot boot
ssh: server1_backup: Name or service not known
Fatal Error: Truncated header string (problem probably originated remotely)
Couldn't start up the remote connection by executing
ssh -C server1_backup rdiff-backup --server
Remember that, under the default settings, rdiff-backup must be
installed in the PATH on the remote system. See the man page for more
information on this. This message may also be displayed if the remote
version of rdiff-backup is quite different from the local version (0.13.4).
I do not understand, i did everything exactly as in the how to...
What could this be? Please let me know.:eek:
Do I have this error because my backup-server is Debian 32 bit and my server 64 bit? If yes, i wonder if i can use rdiff-backup between these two servers...
And if yes, how to solve this problem?
Or is it recomended to use another backup system?
Hans
falko
12th April 2006, 12:32
cd /backup
rdiff-backup server1_backup::/boot boot
ssh: server1_backup: Name or service not known
Fatal Error: Truncated header string (problem probably originated remotely)
The name server1_backup is not known by your system. Either enter server1_backup and its IP address in /etc/hosts, or use server1_backup's IP address, e.g.
rdiff-backup 192.168.0.100::/boot boot
Hans
12th April 2006, 13:54
On my backup server (backup.mydomain.tld) the file contents of /backup/.ssh/config is:
host server1_backup (This name is specified by me)
hostname server1.mydomain.tld (the name of the server to be back-upped).
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2
On my other server server1.mydomain.tld (=to be back-upped), the file contents of file /root/.ssh/authorized_keys is:
command="rdiff-backup --server --restrict-read-only /",from="FULL DNS NAME OF THE BACKUP-SERVER",no-port-forwarding,no-X11-forwarding,no-pty <the key>= rdiff-backup@backup.mydomain.tld
So i do not understand why the names are not recognised.
One more question:
My backup-server is not ping-able from the Internet.
Could that be a reason?
Hans :confused:
Hans
12th April 2006, 23:28
It seems so easy but it is not and it takes me a lot of time.
There is still something wrong, i do not understand!
At Step 4 at URL http://www.howtoforge.com/linux_rdiff_backup_p2
I gave the commands cd /backup
rdiff-backup server1::/boot boot
Then the server asks for a password (3 times) :(
Then an error occurs:
---
Permission denied (publickey,keyboard-interactive).
Fatal Error: Truncated header string (problem probably originated remotely)
Couldn't start up the remote connection by executing
ssh -C server1 rdiff-backup --server
Remember that, under the default settings, rdiff-backup must be
installed in the PATH on the remote system. See the man page for more
information on this. This message may also be displayed if the remote
version of rdiff-backup is quite different from the local version (0.13.4).
---
For information:
The contents of /backup/.ssh/config on the backup server is:
host server1
hostname server1.mydomain.tld
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2
falko
14th April 2006, 00:54
What's in /root/.ssh/authorized_keys on server1.example.com?
Hans
14th April 2006, 09:40
Falko,
for security reasons i give you the information in a private message.
Hans
sjau
19th April 2006, 03:00
I have the same problem
t361:/backup # rdiff-backup backup_roleplayer::/boot boot
ssh: backup_roleplayer: Name or service not known
Fatal Error: Truncated header string (problem probably originated remotely)
Couldn't start up the remote connection by executing
ssh -C backup_roleplayer rdiff-backup --server
Remember that, under the default settings, rdiff-backup must be
installed in the PATH on the remote system. See the man page for more
information on this. This message may also be displayed if the remote
version of rdiff-backup is quite different from the local version (1.0.3).
t361:/backup #
The "backup" server is a suse one (belongs to my friend) and I have a debian sarge one. We thought we can mirror on the other server a daily incremental backup. Taht's why I started it.
Can you help?
Hans
19th April 2006, 11:27
At this moment i also do not have any answers.
It is still not working for me either.
I work always very accurate, but it is not clear to me why that how to is not working for me.
Hans
falko
19th April 2006, 15:39
The "backup" server is a suse one (belongs to my friend) and I have a debian sarge one. We thought we can mirror on the other server a daily incremental backup. Taht's why I started it.
Can you help?
Did you follow the tutorial to the letter? Make sure you didn't make typos somewhere.
sjau
20th April 2006, 23:36
I found the mistake... however the problem now is that my debian machine has an old version of rdiff and my friends suse an up-to-date one.
I did now switch to rsync instead.
Hans
26th April 2006, 19:55
Is it possible that i can not use rdiff-backup because my backup server is part of a internal network, which means that it's IP-address is different than the public IP-address of the network?
Hans is still searching for a solution..
sjau
26th April 2006, 20:17
You need to forward the port to the internal machine from the router.
Hans
26th April 2006, 22:24
Sure. My portforwarding is ok. but i was wondering if it could be a reason.
Soon i will start all over again. I hope i will have more luck!
Did you succeed already?
Hans
falko
26th April 2006, 23:50
Is it possible that i can not use rdiff-backup because my backup server is part of a internal network, which means that it's IP-address is different than the public IP-address of the network?
I don't think that this is causing the problem...
Falko,
I'm still strugling with rdiff-backup:
So i have a question again about this.
In your "how to" you mention at a certain time:
----
su -m rdiff-backup
With this command you become the user rdiff-backup on the shell. All the following commands must be run as user rdiff-backup!
Create the keys:
cd /backup
ssh-keygen -t rsa
Next create the file /backup/.ssh/config with the following contents:
host server1_backup
hostname server1.example.com
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2
Change the permissions of that file: chmod -R go-rwx /backup/.ssh
---
Note: this can not be done as user rdiff-backup !!
If i do it as root instead of user rdiff-backup the result on the file /root/.ssh/authorized_keys is:
ssh-rsa AAAAB3Nza[...]W1go9M= root@backup
in stead of:
ssh-rsa AAAAB3Nza[...]W1go9M= rdiff-backup@backup
Can you explain this?
--
Hans
Note: this can not be done as user rdiff-backup !!
Do I say this in the tutorial, or is this what you experienced? I can't find that sentence in the tutorial... :confused:
Sorry Falko, we did not understand each other:
the text between --- and --- is according your how to.
The line: "Note: this can not be done as user rdiff-backup !!" is my own experience, so i do not understand your line "With this command you become the user rdiff-backup on the shell. All the following commands must be run as user rdiff-backup!" within the how to.
I have to mention this because i can not create file create the file /backup/.ssh/config not do it under user rdiff-backup.
I think also that it is the reason that i have the result:
ssh-rsa AAAAB3Nza[...]W1go9M= root@backup
in stead of:
ssh-rsa AAAAB3Nza[...]W1go9M= rdiff-backup@backup
Hans
All the following commands must be run as user rdiff-backup!"[/B] within the how to.
I have to mention this because i can not create file create the file /backup/.ssh/config not do it under user rdiff-backup.
It is working for me like that. What's rdiff-backup's homedir? Is it /backup?
Yes Falko,
That directory is /backup and is located on my backupserver backup.myhostingcompany.tld.
Hans
What's the output of ls -la /backup?
backup:/home/admin# ls -la /backup
total 28
drwxr-xr-x 4 rdiff-backup rdiff-backup 4096 2006-04-12 20:10 .
drwxr-xr-x 22 root root 4096 2006-04-10 21:03 ..
-rw------- 1 rdiff-backup rdiff-backup 2797 2006-04-14 20:29 .bash_history
-rw-r--r-- 1 rdiff-backup rdiff-backup 567 2006-04-10 21:03 .bash_profile
-rw-r--r-- 1 rdiff-backup rdiff-backup 1834 2006-04-10 21:03 .bashrc
drwxr-xr-x 5 rdiff-backup rdiff-backup 4096 2006-04-10 18:55 boot
drwx------ 2 rdiff-backup rdiff-backup 4096 2006-04-12 18:46 .ssh
backup:/home/admin#
Hans
What's the output of grep rdiff-backup /etc/passwd?
Falko,
here is the output:
backup:/home/admin# grep rdiff-backup /etc/passwd
rdiff-backup:x:3500:3500:rdiff-backup:/backup:/bin/false
Hans
What's the exact error message when you do this as rdiff-backup:
----
su -m rdiff-backup
With this command you become the user rdiff-backup on the shell. All the following commands must be run as user rdiff-backup!
Create the keys:
cd /backup
ssh-keygen -t rsa
Next create the file /backup/.ssh/config with the following contents:
host server1_backup
hostname server1.example.com
user root
identityfile /backup/.ssh/id_rsa
compression yes
cipher blowfish
protocol 2
Change the permissions of that file: chmod -R go-rwx /backup/.ssh
---
Falko,
here is the in- and output, you requested:
backup:/home/admin# su -m rdiff-backup
backup:/home/admin$ cd /backup
backup:/backup$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/backup/.ssh/id_rsa):
/backup/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /backup/.ssh/id_rsa.
Your public key has been saved in /backup/.ssh/id_rsa.pub.
The key fingerprint is:
dc:d6:e2:4d:d1:69:c8:12:e0:1e:a7:2e:f2:51:aa:f5 rdiff-backup@backup.mydomain.tld
backup:/backup$ nano /backup/.ssh/config
Unable to open ~/.nano_history file, Permission denied
Press return to continue starting nano
Note:
The file nano /backup/.ssh/config exists already, the last try, i created it as root. It was the only way i could create it.
--
Hans
This seems to be a problem with nano. I always use vi and never had problems with it...
Wow, :eek:
i did not expect this Falko, but i will try the VI editor.
I let you know, how i am going on.
Thanks for your reply,
Hans
Falko,
You where right about the nano editor. I did everything now with the Unix VI editor and i could make a backup with rdiff-backup.
I have only one more problem that i can not understand:
Before i can make a backup: i have to give root's password to access the server. So i can not go further with creating a cron job for rdiff.
Any ideas?
Hans
Then there seems to something wrong with the certificates...
Falko,
i did it...finally. Thanks for the hint.
Hans :)
Falko,
I have this error when i make a backup with rdiff:
And if i remove the rdiff-backup-data directory i receive a lot of update errors. I guess this is because rdiif creates incremental backups..
Fatal Error: Bad rdiff-backup-data dir on destination side
The rdiff-backup data directory
/backup/server1/rdiff-backup-data
exists, but we cannot find a valid current_mirror marker. You can
avoid this message by removing the rdiff-backup-data directory;
however any data in it will be lost.
Probably this error was caused because the first rdiff-backup session
into a new directory failed. If this is the case it is safe to delete
the rdiff-backup-data directory because there is no important
information in it.
How can i start over again, so i can avoid these errors?
Hans
falko
14th May 2006, 17:00
Remove that directory and check the permissions of the other directories (/backup).
I removed the directory as you told me.
When i do an rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc --exclude /dev --exclude /cdrom server1_backup::/ /backup/server1 the backup works fine again.
One more problem: the /var directory is not backuped as it should be...
What could be the reason for this?
Hans
falko
15th May 2006, 16:37
Any errors in the logs? What's the output of ls -la /var?
admin@server1:/tmp$ ls -la /var
total 108
drwxr-xr-x 16 root root 4096 2006-05-03 21:28 .
drwxr-xr-x 21 root root 4096 2006-03-31 12:56 ..
drwxr-xr-x 2 root root 4096 2006-05-12 06:25 backups
drwxr-xr-x 10 root root 4096 2006-03-31 11:44 cache
drwxr-xr-x 2 root root 4096 2006-04-27 19:53 certs
drwxr-xr-x 24 root root 4096 2006-04-27 19:30 lib
drwxrwsr-x 2 root staff 4096 2005-02-18 15:59 local
drwxrwxrwt 3 root root 4096 2006-05-03 19:23 lock
drwxr-xr-x 10 root root 4096 2006-05-15 06:25 log
drwxr-xr-x 2 root root 49152 2006-03-31 11:48 lost+found
drwxrwsr-x 3 root mail 4096 2006-05-15 13:26 mail
drwxr-xr-x 2 root root 4096 2006-03-31 11:50 opt
drwxr-xr-x 13 root root 4096 2006-05-14 23:59 run
drwxr-xr-x 5 root root 4096 2006-03-31 11:26 spool
drwxrwxrwt 3 root root 4096 2006-05-11 19:10 tmp
drwxr-xr-x 25 root root 4096 2006-05-13 00:30 www
And the output of :
backup:/backup# ls -la /backup
total 32
drwxr-xr-x 5 rdiff-backup rdiff-backup 4096 2006-05-17 02:40 .
drwxr-xr-x 23 root root 4096 2006-05-16 21:04 ..
-rw------- 1 rdiff-backup rdiff-backup 410 2006-05-16 21:20 .bash_history
-rw-r--r-- 1 rdiff-backup rdiff-backup 567 2006-05-16 21:04 .bash_profile
-rw-r--r-- 1 rdiff-backup rdiff-backup 1834 2006-05-16 21:04 .bashrc
drwxr-xr-x 5 rdiff-backup rdiff-backup 4096 2006-03-31 13:23 boot
drwx------ 16 rdiff-backup rdiff-backup 4096 2006-05-17 02:49 server1
drwx------ 2 rdiff-backup rdiff-backup 4096 2006-05-16 21:11 .ssh
Hans
Falko,
For your information: I gave also the command: rdiff-backup server1_backup::/var var
This is what happens:
mknod: `var/lib/named/dev/rdiff-backup.tmp.2312': Operation not permitted
SpecialFileError lib/named/dev/null Error running ['mknod', 'var/lib/named/dev/rdiff-backup.tmp.2312', 'c', '1', '3']
mknod: `var/lib/named/dev/rdiff-backup.tmp.2313': Operation not permitted
SpecialFileError lib/named/dev/random Error running ['mknod', 'var/lib/named/dev/rdiff-backup.tmp.2313', 'c', '1', '8']
UpdateError log/auth.log Updated mirror temp file var/log/rdiff-backup.tmp.2383 does not match source
UpdateError log/daemon.log Updated mirror temp file var/log/rdiff-backup.tmp.2393 does not match source
UpdateError log/httpd/ispconfig_access_log_2006_05_18 Updated mirror temp file var/log/httpd/rdiff-backup.tmp.2421 does not match source
UpdateError log/mail.info Updated mirror temp file var/log/rdiff-backup.tmp.2438 does not match source
UpdateError log/mail.log Updated mirror temp file var/log/rdiff-backup.tmp.2446 does not match source
UpdateError log/munin/munin-graph.log Updated mirror temp file var/log/munin/rdiff-backup.tmp.2461 does not match source
UpdateError log/munin/munin-html.log Updated mirror temp file var/log/munin/rdiff-backup.tmp.2469 does not match source
UpdateError log/munin/munin-limits.log Updated mirror temp file var/log/munin/rdiff-backup.tmp.2477 does not match source
UpdateError log/munin/munin-node.log Updated mirror temp file var/log/munin/rdiff-backup.tmp.2485 does not match source
UpdateError log/munin/munin-update.log Updated mirror temp file var/log/munin/rdiff-backup.tmp.2493 does not match source
UpdateError log/syslog Updated mirror temp file var/log/rdiff-backup.tmp.2528 does not match source
When I gave the command: rdiff-backup server1_backup::/var/www www
Everything goes fine.
Is there no solution for me to backup the whole /var directory?
Hans
falko
18th May 2006, 20:27
There are some special files in your /var directory that cannot be backed up.
You can try to back up /var and exclude /var/lib/named/dev etc., for example.
wr19026
29th August 2006, 15:46
There's one question that I just can't figure out: would HowTo this still work if I have changed /etc/ssh/sshd_config to deny root login:
PermitRootLogin no
Thanks in advance.
wr19026
30th August 2006, 17:16
There's one question that I just can't figure out: would HowTo this still work if I have changed /etc/ssh/sshd_config to deny root login:
PermitRootLogin no
Thanks in advance.
Can anyone answer this question?
falko
30th August 2006, 17:17
You mean on server1.example.com? No, it doesn't work then.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.