diff --git a/views/routine_list.nim b/views/routine_list.nim
index 04c5507..6108f0c 100644
--- a/views/routine_list.nim
+++ b/views/routine_list.nim
@@ -4,7 +4,7 @@ EZ-Bkup is released under the General Public License 3.0.
See COPYING or for details.]#
import owlkettle
-import osproc, os, logging, sequtils
+import osproc, os, logging, sequtils, times
import edit_routine_dialog
import "../models/routine", "../shared"
@@ -27,6 +27,8 @@ proc rsyncThread(list: RoutineListState) {.thread.} =
createDir(appPath)
var logger = newFileLogger(appPath & "/errors.log")
+ let dt = now()
+ let nowDT = dt.format("M-d-YYYY h:mm:ss tt")
#i'm not sure if using threadvar here is needed, but doing it just in case. :)
var rsyncRunCmd {.threadvar.}: string
@@ -57,10 +59,10 @@ proc rsyncThread(list: RoutineListState) {.thread.} =
rsyncRunCmd = "pkexec rsync -aq " & "'" & source & "'" & " " & "'" & destination & "'"
rsyncRun = execCmdEx(rsyncRunCmd)
if rsyncRun.exitCode != 0:
- rsyncErrors.add("EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to back up " & source & " to " & destination)
+ rsyncErrors.add("(" & nowDT & ")" & "EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to back up " & source & " to " & destination)
#handle non-perms related error.
else:
- rsyncErrors.add("EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to back up " & source & " to " & destination)
+ rsyncErrors.add("(" & nowDT & ")" & "EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to back up " & source & " to " & destination)
#explicitly check that sources were copied to destinations.
#just using file names, mod times, and size (same as bkup run itself).
#quote sources and destinations to handle possible spaces.
@@ -74,10 +76,10 @@ proc rsyncThread(list: RoutineListState) {.thread.} =
rsyncCheckCmd = "pkexec rsync -rn " & "'" & source & "'" & " " & "'" & destination & "'"
rsyncCheckRun = execCmdEx(rsyncCheckCmd)
if rsyncCheckRun.exitCode != 0:
- rsyncErrors.add("EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to verify that " & source & " got backed up to " & destination)
+ rsyncErrors.add("(" & nowDT & ")" & "EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to verify that " & source & " got backed up to " & destination)
#handle non-perms related error.
else:
- rsyncErrors.add("EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to verify that " & source & " got backed up to " & destination)
+ rsyncErrors.add("(" & nowDT & ")" & "EZ-Bkup's rsync process(es) returned error (" & $rsyncRun.output & ") while attempting to verify that " & source & " got backed up to " & destination)
if rsyncErrors.len > 0:
list.runStatus = "Error! Please see ~/.ez-bkup/errors.log"