Created
January 6, 2012 14:18
-
-
Save mogya/1570797 to your computer and use it in GitHub Desktop.
bk - create backup file with current date.
This file contains 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
#!/bin/sh | |
#create backup file with current date,like hoge.20120106_231651 | |
#file backup command | |
if [ $# -lt 1 ] | |
then | |
echo "usage: bk files.." | |
echo "create backup files with date string." | |
exit 0; | |
fi | |
EXT=`date +%Y%m%d.%H%M` | |
for FILE in $* | |
do | |
# echo "cp ${FILE} ${FILE}.${EXT}" | |
cp -a ${FILE} ${FILE}.${EXT} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment