adding verbosity..
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# coding=UTF-8
|
||||
import sys
|
||||
import os,time,datetime
|
||||
import sqlite3
|
||||
@@ -115,7 +116,7 @@ def start_sync(options):
|
||||
(SRC,TGT)=sync
|
||||
if not SRC:
|
||||
return
|
||||
print("Starting: #%d %s -> %s"%(i+1,SRC,TGT))
|
||||
print("Starting: #%d %s ─▶ %s"%(i+1,SRC,TGT))
|
||||
syncopts=shlex.split(options.options)
|
||||
command=['rsync']
|
||||
command.extend(syncopts)
|
||||
@@ -129,7 +130,7 @@ def start_sync(options):
|
||||
if '\n' in line:
|
||||
j+=1
|
||||
if j%50==0:
|
||||
line=line.replace("\n","\n#%d %s -> %s\n"%(i+1,SRC,TGT),1)
|
||||
line=line.replace("\n","\n#%d/%d %s ─▶ %s\n"%(i+1,len(sync_list),SRC,TGT),1)
|
||||
j=1
|
||||
sys.stdout.write(line)
|
||||
sys.stdout.flush()
|
||||
@@ -142,8 +143,8 @@ def start_sync(options):
|
||||
lines_iterator = iter(popen.stderr.readline, b"")
|
||||
for line in lines_iterator:
|
||||
sys.stdout.write(line)
|
||||
print("FAILED: EC: %d, %s -> %s"%(popen.returncode,SRC,TGT))
|
||||
print("Finished: #%d %s -> %s"%(i+1,SRC,TGT))
|
||||
print("FAILED: EC: %d, %s ─▶ %s"%(popen.returncode,SRC,TGT))
|
||||
print("Finished: #%d %s ─▶ %s"%(i+1,SRC,TGT))
|
||||
|
||||
def main():
|
||||
options=setup_options();
|
||||
@@ -151,7 +152,7 @@ def main():
|
||||
if not os.path.exists(options.sqlfile):
|
||||
createdb(options.sqlfile);
|
||||
if options.SRC!='' and options.TGT!='':
|
||||
print("Adding: %s -> %s"%(options.SRC,options.TGT))
|
||||
print("Adding: %s ─▶ %s"%(options.SRC,options.TGT))
|
||||
add(options)
|
||||
if options.clear:
|
||||
print("Clearing database")
|
||||
|
||||
Reference in New Issue
Block a user