improve backup script
This commit is contained in:
parent
1c6e30dc83
commit
87101e8349
|
@ -5,24 +5,23 @@ set -x
|
|||
# backup.sh
|
||||
|
||||
pre="/home/fschl"
|
||||
target="/media/driveBay/Backups"
|
||||
target="/media/black_Backups/2018-12"
|
||||
# target="/media/driveBay/Backups"
|
||||
|
||||
folders=( "Documents" #contains Org files
|
||||
"Downloads"
|
||||
"projects"
|
||||
)
|
||||
|
||||
folders_sensitive=( ".gnupg"
|
||||
folders_sensitive=(
|
||||
".mozilla"
|
||||
".thunderbird"
|
||||
".ssh"
|
||||
".config/etc-tinc"
|
||||
)
|
||||
|
||||
files=( ".android"
|
||||
".gradle"
|
||||
files=(
|
||||
".bash_history"
|
||||
".Clion2016.3"
|
||||
)
|
||||
|
||||
main() {
|
||||
|
@ -41,7 +40,19 @@ main() {
|
|||
mkdir -p ${target}/$dir
|
||||
fi
|
||||
echo "${pre}/${dir} --> ${target}/${dir}"
|
||||
rsync --progress -ruv "${pre}/${dir}" "${target}/"
|
||||
rsync --progress -ruv --ignore-existing "${pre}/${dir}" "${target}/"
|
||||
done
|
||||
;;
|
||||
|
||||
sensitive)
|
||||
for dir in "${folders_sensitive[@]}";
|
||||
do
|
||||
if [ ! -d "${target}/${dir}" ]; then
|
||||
echo "creating non-existing dir: ${target}/dotdirectories/${dir}"
|
||||
mkdir -p ${target}/dotdirectories/$dir
|
||||
fi
|
||||
echo "${pre}/${dir} --> ${target}/${dir}"
|
||||
rsync --progress -ruv --ignore-existing "${pre}/${dir}" "${target}/dotdirectories/"
|
||||
done
|
||||
;;
|
||||
|
||||
|
|
Loading…
Reference in New Issue