]> git.pld-linux.org Git - packages/nagios.git/commitdiff
fix silly space in archive filename
authorElan Ruusamäe <glen@delfi.ee>
Mon, 10 Aug 2015 21:19:30 +0000 (00:19 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 10 Aug 2015 21:19:30 +0000 (00:19 +0300)
fixes errors like:

[1439240400] Error: Unable to rename file '/var/log/nagios/nagios.log' to ' /var/log/nagios/archives/nagios-2015-08-11-00.log': No such file or directory

archivelog-timeformat.patch

index 545f524001de2c026926391e5b7e189f91f848f0..12156b0c9d62b6c41094de5325e835e013e21345 100644 (file)
@@ -8,7 +8,7 @@ ideally this should came from config (date_format=iso8601)
  
        /* get the archived filename to use */
 -      asprintf(&log_archive, "%s%snagios-%02d-%02d-%d-%02d.log", log_archive_path, (log_archive_path[strlen(log_archive_path) - 1] == '/') ? "" : "/", t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour);
-+      asprintf(&log_archive,%s%snagios-%04d-%02d-%02d-%02d.log", log_archive_path, (log_archive_path[strlen(log_archive_path) - 1] == '/') ? "" : "/", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour);
++      asprintf(&log_archive, "%s%snagios-%04d-%02d-%02d-%02d.log", log_archive_path, (log_archive_path[strlen(log_archive_path) - 1] == '/') ? "" : "/", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour);
  
        /* rotate the log file */
        rename_result = my_rename(log_file, log_archive);
This page took 0.155404 seconds and 4 git commands to generate.