From 4f82a236266c0a1c7d2f0d255c3fc552fdd5cdb8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 10 Nov 2020 22:01:57 +0100 Subject: [PATCH] unify backup suffixes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/30d4eec937f50c1832cbb2cd462a04be145b2495 Author: vanhofen Date: 2020-11-10 (Tue, 10 Nov 2020) Origin message was: ------------------ - unify backup suffixes ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/scripts/backup.sh | 2 +- src/gui/settings_manager.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data/scripts/backup.sh b/data/scripts/backup.sh index 2c1aa0a8b..2d2098c61 100644 --- a/data/scripts/backup.sh +++ b/data/scripts/backup.sh @@ -3,7 +3,7 @@ . /etc/init.d/globals HOST=$(hostname) -DATE=$(date +%Y-%m-%d_%H-%M-%S) +DATE=$(date +%Y%m%d_%H%M) USRF="/var/tuxbox/config/tobackup.conf" BAKF="$1/${2:-settings_${HOST}_${DATE}.tar.gz}" diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 7c946b2a3..62471be7e 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -106,8 +106,11 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) return res; } - std::string fname = "neutrino.conf"; - CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname); + std::string hostName = ""; + netGetHostname(hostName); + std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M"); + std::string fname = "neutrino_" + hostName + timeStr + ".conf"; + CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname, 45); sms->exec(NULL, ""); delete sms;