From 78aa32279fa43e7c94ceb316d53f767b42bf2182 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 28 Dec 2015 21:13:07 +0530 Subject: [PATCH] restore: extract timestamp from backup filename using bash builtins --- assets/runtime/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/runtime/functions b/assets/runtime/functions index 5c63ee41..f6fc4089 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -1136,7 +1136,8 @@ execute_raketask() { echo "Specified backup does not exist. Aborting..." return 1 fi - BACKUP=$(echo $file | cut -d'_' -f1) + + BACKUP=${file%%_gitlab_backup.tar} fi elif [[ ${1} == gitlab:import:repos ]]; then # sanitize the datadir to avoid permission issues