 (defn finish-trunk-sync [sid trunk-id tail-loc timestamp]
   (let [client (get @clients sid)]
     (a/>!! (:pending-chan client) [1 trunk-id tail-loc]))
-  (reset! (get-in (get @clients sid) [:sync-time trunk-id]) timestamp)
-  #_(switch-log sid trunk-id timestamp))
-
-(defn ^:deprecated  append-log [sid trunk-id act timestamp ^UUID cell-id & [data]]
-  (let [client (get @clients sid)
-        ^OutputStream appender @(get-in client [:appenders trunk-id])
-        act (get {:write 0
-                  :delete 1} act)]
-    (a/>!! pending-logs [appender act timestamp ^UUID cell-id data])))
-
-(defn ^:deprecated  switch-log [sid trunk-id timestamp]
-  (let [client (get @clients sid)
-        log-switch (get-in client [:log-switches trunk-id])
-        base-path (:base-path client)]
-    (.lock log-switch)
-    (try
-      (let [^OutputStream appender @(get-in client [:appenders trunk-id])
-            ^OutputStream new-appender (io/output-stream (str base-path trunk-id "-" timestamp ".mlog"))]
-        (reset! (get-in client [:appenders trunk-id]) new-appender)
-        ;close orignal appender
-        (a/>!! pending-logs [appender -10 timestamp nil]))
-      (finally
-        (.unlock log-switch)))))
-
-(defn ^:deprecated  close-appender [appender]
-  (.flush appender)
-  (.close appender))
-
-(defn ^:deprecated  collect-log [^OutputStream appender act timestamp ^UUID cell-id & [data]]
-  (if (= -10 act)
-    (close-appender appender)
-    (l/append appender act timestamp cell-id data)))
+  (reset! (get-in (get @clients sid) [:sync-time trunk-id]) timestamp))
 
 (defn list-recover-dir []
   (let [path-file (File. ^String @defed-path)

           (java.util UUID)
           (java.util.concurrent.locks ReentrantLock)
           (java.io OutputStream File DataOutputStream)
           (org.apache.commons.io FileUtils)))

(def start-time (System/currentTimeMillis))
(def data-path (atom nil))

  (reset! defed-path path)
  (reset! data-path (str path "/" start-time "/"))
  (when keep-imported? (remove-imported @data-path))
  (println "Starting backup server at:" @data-path))

(defn convert-server-name-for-file [^String str] (.replace str ":" "-"))

