Permalink
Browse files

Add date to create-links backup file name

  • Loading branch information...
1 parent 60b7a4c commit 17fa48293ade59f4df2e7d2beced7d11c015b44d @StephenBrown2 committed Mar 22, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 create-links
View
@@ -12,8 +12,9 @@ for file in [a-zA-Z]* ; do
echo " Removing symbolic link ~/.$file"
rm ~/."$file"
elif [[ -a ~/."$file" ]] ; then
- echo " ~/.$file exists. Moving it to ~/.$file.back"
- mv ~/."$file" ~/."$file".back || echo "Couldn't move ~/.$file to ~/.$file.back!"
+ date=$(date '+%FT%T');
+ echo " ~/.$file exists. Moving it to ~/.$file.back.$date"
+ mv ~/."$file" ~/."$file".back.$date || echo "Couldn't move ~/.$file to ~/.$file.back.$date!"
fi
ln -s `pwd`/"$file" ~/."$file" && echo "Linked ~/.$file to `pwd`/$file" || echo "Couldn't link ~/.$file to `pwd`/$file!"

0 comments on commit 17fa482

Please sign in to comment.