rsnapshot on Debian Jessie not working when using ssh_args

Written by - 0 comments

Published on - Listed in Linux


Came across a problem using rsnapshot on Debian Jessie when I tried to back up data from a remote host using SSH connection.

/usr/bin/rsnapshot -v daily
echo 3796 > /var/run/rsnapshot.pid
mv /backup/rsnapshot/daily.1/ /backup/rsnapshot/daily.2/
/bin/cp -al /backup/rsnapshot/daily.0 /backup/rsnapshot/daily.1
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded /home \
    /backup/rsnapshot/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded /etc \
    /backup/rsnapshot/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --rsh="/usr/bin/ssh -p 2200" root@p01:/etc \
    /backup/rsnapshot/daily.0/p01/
rsync: Failed to exec /usr/bin/ssh -p 2200: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [Receiver=3.1.1]
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in IPC code (code 14) at io.c(226) [Receiver=3.1.1]
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -v daily
----------------------------------------------------------------------------
ERROR: /usr/bin/rsync returned 14 while processing root@p01:/etc/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --rsh="/usr/bin/ssh -p 2200" root@p01:/mnt/containerdata \
    /backup/rsnapshot/daily.0/p01/
rsync: Failed to exec /usr/bin/ssh -p 2200: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [Receiver=3.1.1]
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in IPC code (code 14) at io.c(226) [Receiver=3.1.1]
ERROR: /usr/bin/rsync returned 14 while processing root@p01:/mnt/containerdata/
touch /backup/rsnapshot/daily.0/
rm -f /var/run/rsnapshot.pid

 The problem seems to come from the ssh_args setting in rsnapshot.conf:

# ssh has no args passed by default, but you can specify some here.
#
ssh_args    -p 2200

 As the host, where I want to pull the backups from listens on port 2200, I enabled this option. I know for a fact that this was working on Debian Wheezy (rsnapshot 1.3.1-3). In Jessie this is rsnapshot 1.3.1-4 and seems broken.

I came across Ubuntu bug 1309710 and Debian bug 721043 which are basically the same. Indeed since 1.3.1-4 there seems to be a problem when ssh_args are used.

According to the Debian bug report, the bug was fixed in version 1.4.0-1 but as of today (March 2016) this version is not available on Jessie; only on Stretch which is the "testing" version at the moment. So much for "stable" :-(

For now I have solved this problem by defining the special port in the ssh client config:

cat ~/.ssh/config
Host p01
  Hostname p01
  User root
  Port 2200

 in rsnapshot.conf I disabled ssh_args again:

cat /etc/rsnapshot.conf | grep ssh_args -B 1
# 20160317 Claudio: DO NOT TOUCH, ITS BROKEN IN JESSIE!!!!
#ssh_args    -p 2200

And now rsnapshot runs as it should because the ssh options come directly from the ssh client and not from the config file:

/usr/bin/rsnapshot -v daily
echo 3916 > /var/run/rsnapshot.pid
mv /backup/rsnapshot/daily.2/ /backup/rsnapshot/daily.3/
mv /backup/rsnapshot/daily.1/ /backup/rsnapshot/daily.2/
/bin/cp -al /backup/rsnapshot/daily.0 /backup/rsnapshot/daily.1
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded /home \
    /backup/rsnapshot/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded /etc \
    /backup/rsnapshot/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --rsh=/usr/bin/ssh root@p01:/etc /backup/rsnapshot/daily.0/p01/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --rsh=/usr/bin/ssh root@p01:/mnt/containerdata \
    /backup/rsnapshot/daily.0/p01/

Update April 4th 2016:
The bug is now also fixed in Debian Jessie (since Release 8.4). From the apt changelog:

rsnapshot (1.3.1-4+deb8u1) jessie; urgency=medium

  * debian/patches/14_fix_rsh_args: fix regression on --rsh with args:
    Applied patch from Upstream to fix --rsh command line arguments with quotes.
    The --rsh=... argument to rsync was erroneously quoted when added to the
    @rsync_long_args_stack with options set. Thanks Jonas Genannt for the
    help.
-- Guillaume Delacour <gui@iroqwa.org>  Sun, 25 Oct 2015 23:33:28 +0100

  


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder