- helpers: add function to get backup suffix

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2020-11-12 22:17:34 +01:00
committed by Thilo Graf
parent 9b87fa8cd8
commit 31cea8ca29
2 changed files with 9 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
//#include <driver/framebuffer.h>
#include <system/helpers.h>
#include <system/helpers-json.h>
#include <lib/libnet/libnet.h>
#include <gui/update_ext.h>
#include <libmd5sum.h>
#define MD5_DIGEST_LENGTH 16
@@ -493,6 +494,13 @@ std::string getFileExt(std::string &file)
return _getBaseName(f, ".");
}
std::string getBackupSuffix()
{
std::string hostName = "";
netGetHostname(hostName);
return hostName + getNowTimeStr("_%Y%m%d_%H%M");
}
std::string getNowTimeStr(const char* format)
{