2

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 john@192.168.0.102:/media/linuxstorage/docs/

What does return code "12" mean?

Brad Grissom
  • 3,633
  • 3
  • 21
  • 23
  • 1
    I just encountered this issue, which in my case appeared to be a collision between a long-running hourly backup and a subsequently scheduled daily backup that started before the hourly process had completed. The "hourly" rsnapshot.pid (lockfile) was thus present, triggering the error. – Victoria Stuart Apr 22 '20 at 17:55

2 Answers2

5

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.

john@192.168.0.102'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 bgrissom@192.168.0.102:/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 john@192.168.0.102
Brad Grissom
  • 3,633
  • 3
  • 21
  • 23
0

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.

lewis4u
  • 14,256
  • 18
  • 107
  • 148