diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2026-01-25 18:04:08 +0100 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2026-01-25 18:05:08 +0100 |
| commit | effe1f88979dc6768f07c74dda7ea2a352959a41 (patch) | |
| tree | b04ab7016765833f734dca92e811142e228366b1 | |
| parent | 016ddf36a4f530bd79289baf106f21b716c877f0 (diff) | |
Outline of ftag sync pull
| -rw-r--r-- | src/main.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1088,6 +1088,9 @@ static void ftag_query(int argc, char **argv) * - negative value if remote ftag database is newer than the local one. */ static int ftag_sync_compare_mtimes(void) { + /* TODO: create get_mtime routines + + This will be useful in pull/push routines implementation. */ char *remote_path = FTAG_REMOTE_ROOT "/ftag.sqlite3"; char cmd[1024]; strbuild(cmd, "ssh %s 'test -f %s && stat --format=%%Y %s || echo 0'", @@ -1133,7 +1136,19 @@ static void ftag_sync_pull(void) { if (!ftag_sync_is_remote_newer()) return; - /* TODO: resume here */ + char remote_arg[128]; + strbuild(remote_arg, "%s:%s/%s", + FTAG_REMOTE_HOST, FTAG_REMOTE_ROOT, "ftag.sqlite3"); + char *cmd[] = { + "scp", + DATABASE_PATH, + remote_arg, + NULL + }; + ftag_execvp(cmd, 1); + /* TODO: manually set local and remote mtime + + Make them equal to avoid further unecessary pull/push. */ } static void ftag_sync(int argc, char **argv) |
