add backup-it func

This commit is contained in:
TheK4n 2022-01-11 01:45:23 +03:00
parent e830180e03
commit 7999b5b890
3 changed files with 15 additions and 6 deletions

View File

@ -13,10 +13,9 @@ if [ -x "$(which dircolors)" ]; then
alias ls='ls --color=auto'
fi
# these aliases use the "ls" alias, which was defined earlier
alias l.='ls -AF --ignore="*"'
alias ll='ls -lhF'
alias la='ls -AF'
alias l.='ls -A --ignore="*"'
alias ll='ls -lh'
alias la='ls -A'
alias lt='du -sh * | sort -h'

View File

@ -8,7 +8,7 @@ lsl () {
DIR="$(pwd)"
fi
ls -lhFA --color=always "${DIR}" | less -R
ls -lhFA --color=always "${DIR}" | tail -n +2 | less -R
}
workon() {
@ -114,3 +114,13 @@ json() {
python -m json.tool | pygmentize -l javascript
fi
}
backup-it() {
local cur_dir_name bkp_dir
bkp_dir=~/Backup/$(date +"%d-%m-%y")
cur_dir_name="$(basename "$PWD")"
mkdir -p "$bkp_dir"/"$cur_dir_name" || true
tar czf - * | gpg -c > "$bkp_dir"/"$cur_dir_name"/"$(date +"%H-%M-%S")".tar.gz.gpg
}

View File

@ -13,7 +13,7 @@ _workon()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
envs=`ls /opt/pythonenv/`
envs=$(ls /opt/pythonenv/)
COMPREPLY=( $(compgen -W "${envs}" -- ${cur}) )
}