From ab44572ba4f3cedfb27c6e26b60ca75bfdc4ecdf Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 14 Dec 2010 14:33:16 +0100 Subject: [PATCH] added minimal config backup function buf() --- plugins/base.plugin.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index 9c8cb92..02c0104 100644 --- 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} +} -- 2.17.1