From effe1f88979dc6768f07c74dda7ea2a352959a41 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 25 Jan 2026 18:04:08 +0100 Subject: Outline of ftag sync pull --- src/main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index c33ea36..8c47d67 100644 --- a/src/main.c +++ b/src/main.c @@ -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) -- cgit v1.2.3