Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can use rsync to show differences between two directories without changing anything. In the following example, your /home/myuser is compared with the same folder on computer target:rsync -e ssh -avz --delete --dry-run /home/myuser root@target:/home
This comparison only considers timestamps and file sizes. For comparing directories based on content, use other programs, e.g. krusader.

Inkrementális mentés

Forrás

Code Block
themeEclipse
languagebash
titleInkrementális mentés példa
#!/bin/bash
#Backup Script

#Mai nap ISO-8601 formátumban:
DAY0=`date -I`

#Egyéb napok ISO-8601 formátumban:
DAY7=`date -I -d "7 days ago"`
DAY28=`date -I -d "28 days ago"`

#Menteni kívánt mappa elérése
SRC="/home/david/dir1"

# Mentés helyének megadása
TRG="/home/david/dir2/$DAY0"

#Link helyének megadása
LNK="/home/david/dir2/$DAY7"

#rsync beállítás:
OPT="-avh --delete --link-dest=$LNK"

#rsync inkrementális mentés, linkmegadással.
rsync $OPT $SRC $TRG

#Valtozok
dir2="/home/david/dir2"
dir3="/home/david/dir3"

#28 nappal ezelőtti inkrementális mentések törlése
if [ -d $dir2/$DAY28 ]
then
rm $dir2/$DAY28
fi

#28 naponta "havi" mentés

if [ ! -f $dir2/$DAY7 ]
then 
rsync -avh $SRC $dir3
else if [ -d $dir3/$DAY28]
then 
rsync -avh $SRC $dir3
fi
fi - See more at: http://rendszerinformatika.hu/bootcamp/rsync-inkrementalis-mentes/#sthash.fAH52nVQ.dpuf