Я использую простой скрипт для rsync.
Он сохраняет (a) некоторые папки только на внешнем диске [LTDS для папки], (b) другие синхронизируются с локальным диском [LTDD ] для этого списка], (c) также поддерживаются копии файлов точек (последние 4 строки этого скрипта).
Моя внешняя жесткая директория называется box. И в сценарии он жестко закодирован, поскольку путь распространения: DEST="/media/box".
#!/bin/bash
# This script provides two types of backups
# * LTDS (stands for 'list delete orig at source'): the one which delete files on the DEST, and
# * LTDD (stands for 'list delete orig at destination'): the one which doesn't.
# Note that starting DEST folders has to be before the sync.
# Type in the lists the folders subject to the sync (all paths reletive to the $HOME):
# for movies and soft (to keep them at the remote HDD only):
LTDS="/Box/mixed/Movies/"
# for songs, books, documents (to keep them synced both: at HOME and at remote HDD):
LTDD="/Box/sonic/ /Box/visual/ /Box/wordy/ /Documents/ /Downloads/ /Passed/ /Pictures/ /Study/ /Work/"
DEST="/media/box"
for i in $LTDS; do
rsync -aq --progress $HOME$i $DEST$i
rm -rf $HOME$i*
done
for i in $LTDD; do
rsync -aq --delete-after --progress $HOME$i $DEST$i
done
# the following back-ups all the dot files in your home dir.
dotfiles=`ls -A | grep '\.'`
for i in $dotfiles; do
rsync -aq --progress $HOME/$i $DEST/Misc/dotfiles
done
Я использую этот скрипт довольно давно. Он отлично работает.