diff --git a/main.c b/main.c index 1071ad3..b57fa20 100644 --- a/main.c +++ b/main.c @@ -803,6 +803,30 @@ nextopt: parse(epgpath, sqlitedump, NULL, filter); sqlitedumpend(argv[1]); } + else if (!strcmp(argv[0], "sqlitedumpd") && argc == 2) + { + time_t last = 0; + for (;;) + { + struct stat st; + + if (stat(epgpath, &st) == -1) + { + perror("stat"); + return 1; + } + + if (st.st_mtime > last) + { +printf("epgd: DB time %ld > last %ld\n", st.st_mtime, last); + sqlitedumpstart(argv[1]); + parse(epgpath, sqlitedump, NULL, filter); + sqlitedumpend(argv[1]); + } + last = st.st_mtime; + sleep(900); + } + } #endif else if (!strcmp(argv[0], "now")) {