Code Review
/
common
/
bash_it.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
2ce1267
)
added minimal config backup function buf()
author
Florian Baumann
<flo@noqqe.de>
Tue, 14 Dec 2010 13:33:16 +0000
(14:33 +0100)
committer
Florian Baumann
<flo@noqqe.de>
Tue, 14 Dec 2010 13:33:16 +0000
(14:33 +0100)
plugins/base.plugin.bash
patch
|
blob
|
history
diff --git
a/plugins/base.plugin.bash
b/plugins/base.plugin.bash
index
9c8cb92
..
02c0104
100644
(file)
--- a/
plugins/base.plugin.bash
+++ b/
plugins/base.plugin.bash
@@
-87,4
+87,10
@@
function plugins-help() {
| grep -v "COMPREPLY=()" | sed -e "s/()//"
}
-
+# back up file with timestamp
+# useful for administrators and configs
+buf () {
+ filename=$1
+ filetime=$(date +%Y%m%d_%H%M%S)
+ cp ${filename} ${filename}_${filetime}
+}