rsnapshot on Linux fails with "returned 12 while processing"

6.8k Views Asked by At

I thought I had rsnapshot all setup properly, but after checking my logs the next day I found the following:

[05/Sep/2014:10:34:11] /usr/bin/rsnapshot daily: ERROR: /usr/bin/rsync returned 12 while processing [email protected]:/media/linuxstorage/docs/

What does return code "12" mean?

2

There are 2 best solutions below

0
On

To see what was going on, I ran it manually and went off to do other things:

raspberrypi $ sudo rsnapshot daily

Well lo and hehold, it had been sitting there waiting for my password.

[email protected]'s password: 
Connection closed by 192.168.0.102
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot daily 
----------------------------------------------------------------------------
ERROR: /usr/bin/rsync returned 12 while processing [email protected]:/medi/linuxstorage/docs/

I had changed the rsnapshot user from pi to root in /etc/crontab and root was not setup the "ssh without a password" keys for the remote host. All I had to do to fix this is:

raspberrypi $ sudo bash
raspberrypi # ssh-copy-id [email protected]
0
On

The fact: return code "12" means there is something wrong with authentication to remote server.

I ran into this also and seems like this is the most common problem for getting that error:

ERROR: /usr/bin/rsync returned 12 while processing .....

Problem: rsnapshot uses rsync under the hood and can't connect because you probably never actually connected to that remote server.

Solution: You have to connect to that remote server at least once manually through terminal from that machine where rsnapshot is running

with: ssh remote_user@remote_server.domain

so that you confirm the connection and then entry can be made to known_hosts!

After that rsnapshot worked for me.