#include <signal.h>
#include <string.h>
+#include <snapper/AppUtil.h>
#include <snapper/Compare.h>
using namespace snapper;
daemon(0, 0);
+ initDefaultLogger();
+
+ string path1 = argv[1];
+ string path2 = argv[2];
+ string output = argv[3];
+
+ y2mil("compare-dirs path:" << path1 << " path2:" << path2 << " output:" << output);
+
struct sigaction act;
act.sa_handler = terminate;
sigemptyset(&act.sa_mask);
sigaction(SIGINT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
- tmp_name = (char*) malloc(strlen(argv[3]) + 12);
- strcpy(tmp_name, argv[3]);
+ tmp_name = (char*) malloc(output.length() + 12);
+ strcpy(tmp_name, output.c_str());
strcat(tmp_name, ".tmp-XXXXXX");
int fd = mkstemp(tmp_name);
file = fdopen(fd, "w");
- cmpDirs(argv[1], argv[2], write_line);
+ cmpDirs(path1, path2, write_line);
fclose(file);
- rename(tmp_name, argv[3]);
+ rename(tmp_name, output.c_str());
free(tmp_name);
#include <stdlib.h>
+#include <snapper/AppUtil.h>
#include <snapper/Snapper.h>
#include <snapper/Factory.h>
exit(EXIT_FAILURE);
}
+ initDefaultLogger();
+
string root = argv[1];
+ y2mil("daily root:" << root);
+
Snapper* sh = createSnapper(root);
sh->doCleanupAmount();
#include <stdlib.h>
+#include <snapper/AppUtil.h>
#include <snapper/Snapper.h>
#include <snapper/Factory.h>
exit(EXIT_FAILURE);
}
+ initDefaultLogger();
+
string root = argv[1];
+ y2mil("hourly root:" << root);
+
if (root != "/") // TODO
exit(EXIT_SUCCESS);