Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!sh
# Default folders
BackUpFolder=/e/Backup;
BackUpFolderUser=$BackUpFolder/user;
echo "| Back up user files script"
echo "| AUTHOR : Alexnader Davronov"
echo "| CREATED at : 11.04.2019"
echo "| BACK UP FOLDER : $BackUpFolder"
echo "| Initializing...."
# --------< SETTING UP DEFAULT FUNCTIONS >--------
# Back up GIT files function
backUpUserFiles () {
echo
echo " Backuping user files ..."
echo " destination: $1"
local UserFiles="
.bash_history
.bash_profile
.bashrc
.cmdrc.cmd
.dbshell
.gitconfig
.mongorc.js
.node_repl_history
.npmrc
.yarnrc
docker
docker-machine
";
for file in $UserFiles
do
cp -u $HOME/$file $1
# rm $BackUpFolder/$file
echo " copy ${file}"
done
}
#--------<RUNNINGFUNCTIONS>--------
backUpUserFiles $BackUpFolderUser
cp $0 $BackUpFolder
echo "| Done...."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.