Added backup option

This commit is contained in:
Kevin Veen-Birkenbach 2021-01-23 11:03:48 +01:00
parent df11df9f25
commit 7b583ef0dd

View File

@ -18,7 +18,7 @@ for folder in "${directories[@]}"; do
else else
if [ -d "$cloud_directory" ] if [ -d "$cloud_directory" ]
then then
mv -v "$home_directory/"* "$cloud_directory/" && mv --backup -v "$home_directory/"* "$cloud_directory/" &&
rmdir -v "$home_directory" && rmdir -v "$home_directory" &&
ln -vs "$cloud_directory" "$home_directory" && ln -vs "$cloud_directory" "$home_directory" &&
echo "Folder $home_directory is now syncronized with cloud." || exit 1 echo "Folder $home_directory is now syncronized with cloud." || exit 1