fast backup file w/ bf() shell function.

This commit is contained in:
motius 2017-08-09 15:28:35 +02:00
parent 0b689b1827
commit c714789432
1 changed files with 6 additions and 0 deletions

View File

@ -204,6 +204,12 @@ DATE=$(/bin/date +%Y-%m-%d_%H:%M:%S.%N)
local TMPFILE=tmp.${DATE}.sw local TMPFILE=tmp.${DATE}.sw
mv "$1" $TMPFILE && mv "$2" "$1" && mv $TMPFILE $2 mv "$1" $TMPFILE && mv "$2" "$1" && mv $TMPFILE $2
} }
bf()
{
DATE=$(/bin/date +%Y-%m-%d_%H:%M:%S.%N)
local TMPFILE=tmp.${DATE}.bak
/bin/cp "$1" $TMPFILE
}
fi fi
#date() { #date() {