       (info "Writing tweets backup...")
       (db/backup-yesterday "demeter" "tweets" path)))
 
-(defjob ReactionsBackup [ctx]
+(defjob RefsBackup [ctx]
   (let [path (get (qc/from-job-data ctx) "folder-path")]
-      (info "Writing reactions backup...")
-    (db/backup-yesterday "demeter" "reactions" path)))
-
-(defjob PubsBackup [ctx]
-  (let [path (get (qc/from-job-data ctx) "folder-path")]
-      (info "Writing publications backup...")
-    (db/backup-yesterday "demeter" "publications" path)))
+      (info "Writing refs backup...")
+    (db/backup-yesterday "demeter" "refs" path)))
 
 (defjob UrlsBackup [ctx]
   (let [path (get (qc/from-job-data ctx) "folder-path")]

    (qs/schedule job trigger)))


(defn pubs-backup-schedule
  "Create a schedule to backup the reactions at 3.15 am"
  [path]
  (let [job (j/build
             (j/of-type PubsBackup)
             (j/using-job-data {"folder-path" path})
             (j/with-identity (j/key "jobs.pubsbackup.1")))
        tk (t/key "triggers.4")
        trigger (t/build
                 (t/with-identity tk)
                 (t/start-now)
                 (t/with-schedule
                   (schedule
                    (every-day)
                    (starting-daily-at (time-of-day 3 15 00))
                    (ending-daily-at (time-of-day 3 15 01)))))]
    (qs/schedule job trigger)))


(defn urls-backup-schedule

  (qs/start)
  (tweets-backup-schedule path)
  (htmls-backup-schedule path)
  (refs-backup-schedule path)
  (urls-backup-schedule path)
  (users-backup-schedule path)
  (messages-backup-schedule path)
  (hashtags-backup-schedule path))
