Skip to content

Instantly share code, notes, and snippets.

@tgck
Created November 8, 2012 16:52
Show Gist options
  • Save tgck/4040019 to your computer and use it in GitHub Desktop.
Save tgck/4040019 to your computer and use it in GitHub Desktop.
bash_profile with backup alias
#!/bin/bash
export PS1="\W:\!\$ "
# bkコマンド
bk() {
if [ -d $1 ]; then
tar cvf $(date +"%Y%m%d_%H%M%S")_${1#\/}_bkup.tar $1;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment