From: Sebastian Pipping Date: Thu, 13 Jan 2011 14:06:54 +0000 (+0100) Subject: Add timestamps to .config backup names (e.g. .config--2011-01-13--15-01-53.bak) so... X-Git-Tag: v3.4.11~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8d89dba5d75fb44d2e5da6ebbfe00b526d3148ac;p=genkernel.git Add timestamps to .config backup names (e.g. .config--2011-01-13--15-01-53.bak) so .config.bak doesn't get lost when running genkernel multiple times --- diff --git a/gen_configkernel.sh b/gen_configkernel.sh index ee76ec1..b562287 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -35,9 +35,10 @@ config_kernel() { print_info 1 "config: Using config from ${KERNEL_CONFIG}" if [ -f "${KERNEL_DIR}/.config" ] then - cp "${KERNEL_DIR}/.config" "${KERNEL_DIR}/.config.bak" \ + NOW=`date +--%Y-%m-%d--%H-%M-%S` + cp "${KERNEL_DIR}/.config" "${KERNEL_DIR}/.config${NOW}.bak" \ || gen_die "Could not backup kernel config (${KERNEL_DIR}/.config)" - print_info 1 ' Previous config backed up to .config.bak' + print_info 1 " Previous config backed up to .config${NOW}.bak" fi cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could not copy configuration file!' fi