added minimal config backup function buf()
authorFlorian Baumann <flo@noqqe.de>
Tue, 14 Dec 2010 13:33:16 +0000 (14:33 +0100)
committerFlorian Baumann <flo@noqqe.de>
Tue, 14 Dec 2010 13:33:16 +0000 (14:33 +0100)
plugins/base.plugin.bash

index 9c8cb92..02c0104 100644 (file)
@@ -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}
+}