Tag Archives: rsync

rsync error: protocol incompatibility (code 2) at compat.c(171) [sender=3.0.6]

If you have this kind of error:

tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
protocol version mismatch — is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(171) [sender=3.0.6]

Fix.

vi /root/.bashrc

if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi

create rsync incremental backups with hardlinking

Quite short and simple bash script:

#!/bin/bash
# Simple weekly bash backup script all variables explain themselves
# Version 1.03

what=”/ka”
where=”/ba”
set -e

today=$(date +’%Y-%m-%d’)
last=$(ls -r $where | head -1)
delete=$(ls -r $where | tail -n +7)

cd $where
nice -n 19 rsync –bwlimit=10000 –info=progress2 –link-dest=$where/$last $what $where/$today

[ -z “$delete” ] || rm -rf $delete