From 93d76e02ec3cb3c00c5fb9014aae76bc33023acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 4 Mar 2015 18:02:12 +0100 Subject: [PATCH] Feature #3537: Add date & time to oned backup file --- src/onedb/onedb_backend.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/onedb/onedb_backend.rb b/src/onedb/onedb_backend.rb index 6f2a69bed0..ae07eab38c 100644 --- a/src/onedb/onedb_backend.rb +++ b/src/onedb/onedb_backend.rb @@ -14,6 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require 'time' require 'rubygems' begin @@ -229,7 +230,9 @@ class BackEndMySQL < OneDBBacKEnd end def bck_file - "#{VAR_LOCATION}/mysql_#{@server}_#{@db_name}.sql" + t = Time.now + "#{VAR_LOCATION}/mysql_#{@server}_#{@db_name}.sql_"<< + "#{t.year}-#{t.month}-#{t.day}_#{t.hour}:#{t.min}:#{t.sec}.bck" end def backup(bck_file) @@ -299,7 +302,9 @@ class BackEndSQLite < OneDBBacKEnd end def bck_file - "#{VAR_LOCATION}/one.db.bck" + t = Time.now + "#{VAR_LOCATION}/one.db_"<< + "#{t.year}-#{t.month}-#{t.day}_#{t.hour}:#{t.min}:#{t.sec}.bck" end def backup(bck_file)