Add -I to rsync to overwrite files in the dest

This commit is contained in:
Stephan Raabe 2023-11-24 13:19:48 +01:00
parent 1a662915b3
commit 8d52e744e4
4 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
if [ ! -z $1 ] ;then if [ ! -z $1 ] ;then
if [ -d ~/dotfiles-versions/"$1" ] ;then if [ -d ~/dotfiles-versions/"$1" ] ;then
echo "Folder exists. Start rsync now ..." echo "Folder exists. Start rsync now ..."
rsync -avzh --exclude-from=excludes.txt ~/dotfiles-versions/$1/ ~/dotfiles rsync -avzh -I --exclude-from=excludes.txt ~/dotfiles-versions/$1/ ~/dotfiles
else else
echo "Folder ~/dotfiles-versions/$1 not found." echo "Folder ~/dotfiles-versions/$1 not found."
fi fi

View File

@ -53,7 +53,7 @@ if gum confirm "Do you want to install the prepared dotfiles now?" ;then
mkdir ~/dotfiles mkdir ~/dotfiles
echo "~/dotfiles folder created." echo "~/dotfiles folder created."
fi fi
rsync -a ~/dotfiles-versions/$version/ ~/dotfiles/ rsync -a -I ~/dotfiles-versions/$version/ ~/dotfiles/
echo "All files from ~/dotfiles-versions/$version/ to ~/dotfiles/ copied." echo "All files from ~/dotfiles-versions/$version/ to ~/dotfiles/ copied."
else else
echo "Skipped: DEV MODE!" echo "Skipped: DEV MODE!"

View File

@ -26,6 +26,6 @@ else
mkdir ~/dotfiles-versions/$version mkdir ~/dotfiles-versions/$version
echo "Clean build prepared for the installation." echo "Clean build prepared for the installation."
fi fi
rsync -a --exclude-from=.install/excludes.txt . ~/dotfiles-versions/$version/ rsync -a -I --exclude-from=.install/excludes.txt . ~/dotfiles-versions/$version/
echo "dotfiles $version successfully prepared in ~/dotfiles-versions/$version/" echo "dotfiles $version successfully prepared in ~/dotfiles-versions/$version/"
echo "" echo ""

View File

@ -5,7 +5,7 @@
# |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_|
# |___/|_| # |___/|_|
# #
# by Stephan Raabe (2023) # by Stephan Raabe (2023)
# ----------------------------------------------------- # -----------------------------------------------------
# ----------------------------------------------------- # -----------------------------------------------------