Rsync

Gandalf style

rsync -aAvXz --numeric-ids -e "ssh" --exclude="/dev" --exclude="/proc" --exclude="/sys" login@host:/ .

rsync -aAvXWH --numeric-ids -e "ssh -c blowfish-cbc" root@192.168.1.100:/mnt/* .

hlaska protocol version mismatch – is your shell clean?

zkus se pripojit ssh host /bin/true

Vyhleda pocet vyskytu IP adresy v logu /var/log/apache/access.log |cut -f 1 -d ' '|sort|uniq -c|sort -nr|more

Sync permissions bez obsahu souboru

Pokud se nam povedlo syncnout adresar bez numeric-ids, zjistime to se zpozdenim a chcem je dosyncnout dodatecne na produkcni data, muzem pouzit tenhle skript:

#!/bin/bash #set -x fixperms() { echo "FIXING $SUFFIX in $@ $(date)" cd "$3""$SUFFIX" IFS=$'\t' ssh "$1" -- 'find '"$2$SUFFIX"' -printf "%m\t%U:%G\t%u:%g\t%P\n"' | tail -n +2 | while read -a line; do chmod "${line[0]}" "${line[3]}" #set mode chown -h "${line[1]}" "${line[3]}" #set numeric ids #echo chown -h "${line[2]}" "${line[3]}" #set name ids done; } #SUFFIX=/home fixperms server.example.com /vzdaleny/adresar/ /lokalni/adresar/