mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 06:56:28 -05:00
Adds date and time specifier for the log file name.
This commit is contained in:
parent
f6c2ae14de
commit
cb0a280ddc
9 changed files with 154 additions and 31 deletions
11
state.c
11
state.c
|
|
@ -347,6 +347,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
unsigned line;
|
||||
tommy_node* i;
|
||||
unsigned l;
|
||||
time_t t;
|
||||
struct tm* tm;
|
||||
|
||||
/* copy the options */
|
||||
state->opt = *opt;
|
||||
|
|
@ -357,7 +359,16 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
|
||||
state->command = command;
|
||||
|
||||
t = time(0);
|
||||
tm = localtime(&t);
|
||||
|
||||
fprintf(stdlog, "version:%s\n", PACKAGE_VERSION);
|
||||
fprintf(stdlog, "unixtime:%"PRIi64"\n", (int64_t)t);
|
||||
if (tm) {
|
||||
char datetime[64];
|
||||
strftime(datetime, sizeof(datetime), "%F %T", tm);
|
||||
fprintf(stdlog, "time:%s\n", datetime);
|
||||
}
|
||||
fprintf(stdlog, "conf:%s\n", path);
|
||||
fflush(stdlog);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue