Created
May 10, 2020 14:10
-
-
Save LordShedy/b3e43dae16fcd65784044d2c4cf1f9f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bk() { | |
if [[ -z $1 ]]; then | |
echo "Please, enter a path to a file to create the backup file of!" | |
else | |
local __path=${1} | |
local __timestamp=`date +'%Y%m%d%H%M'` | |
local __backup_file="${__path}.${__timestamp}.bk" | |
[[ -f "${__path}" ]] && cp "${__path}" "${__backup_file}" | |
echo "File "$1" was backed up as ${__backup_file}" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment