Rename vars src and dest.

This commit is contained in:
Peter Green 2023-01-08 19:47:27 +00:00
parent b4d8eb7cf1
commit 666677e684
1 changed files with 15 additions and 9 deletions

View File

@ -14,10 +14,16 @@
# Run the script
#./Backup.sh
# Change the following variables to suit your setup...
# Find out what the dest and src are...
src=/home/somebody
dest=/media/truecrypt1
echo "Please enter your source path"
read -r src
sed -i "s|source=|source=/$src|" Backup.sh
echo "Please enter your destination path"
read -r dest
sed -i "s|destination=|"destination=/dest Backup.sh
source=
destination=
# End variables
@ -81,20 +87,20 @@ done
# Backup Firefox if required to do so by the user.
if [ "$ff" = 'y' ]
then mv $dest/.mozilla $dest/.mozilla-"$(/bin/date +%Y-%m-%d--%H:%M:%S)" && rsync -av --progress $src/.mozilla $dest
else echo "Firefox not being backed up."
then mv "$dest"/.mozilla "$dest"/.mozilla-"$(/bin/date +%Y-%m-%d--%H:%M:%S)" && rsync -av --progress "$source"/.mozilla "$destination"
else echo "Firefox not being backed up."
fi
# Backup Thunderbird if required to do so by the user.
if [ "$tb" = 'y' ]
then mv $dest/.thunderbird $dest/.thunderbird-"$(/bin/date +%Y-%m-%d--%H:%M:%S)" && rsync -av --progress $src/.thunderbird $dest
else echo "Thunderbird not being backed up."
then mv "$destination"/.thunderbird "$destination"/.thunderbird-"$(/bin/date +%Y-%m-%d--%H:%M:%S)" && rsync -av --progress "$source"/.thunderbird "$destination"
else echo "Thunderbird not being backed up."
fi
# Backup home dir' if required to do so by the user. Note that the desktop is backed up differentially whereas the rest of the home dir' is backed up incrementally.
if [ "$home" = 'y' ]
then rsync -av --progress --delete-after $src/Desktop/ $dest/Desktop && rsync -av --progress --delete $src/Downloads/ $dest/Downloads && rsync -av --progress --exclude 'Desktop' --exclude '.mozilla' --exclude '.thunderbird' --exclude 'Downloads' $src/ $dest
else echo "Home not being backed up."
then rsync -av --progress --delete-after "$source"/Desktop/ "$destination"/Desktop && rsync -av --progress --delete "$source"/Downloads/ "$destination"/Downloads && rsync -av --progress --exclude 'Desktop' --exclude '.mozilla' --exclude '.thunderbird' --exclude 'Downloads' "$source"/ "$destination"
else echo "Home not being backed up."
fi
# Let the user know we have finished!