From a72855200267fa484422ca90f3b71f3423213616 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 8 Sep 2016 21:14:04 +0200 Subject: [PATCH] bin/owncloud-sync --- bin/owncloud-sync | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/owncloud-sync b/bin/owncloud-sync index a56dbc7b..211c3763 100755 --- a/bin/owncloud-sync +++ b/bin/owncloud-sync @@ -109,7 +109,7 @@ owncloud_sync() { #owncloudcmd -n --non-interactive "$1" "$2" 2>&1 | perl -ne 'print if s/^!!!\s*OCC:://' #owncloudcmd -n --non-interactive "$1" "$2" 2>&1 | perl -ne 'print join(" ",@_)."\n" and next if @_=/OCC::(\S+).*?"(.*?)" "(.*?)"/;' owncloudcmd -n --non-interactive "$1" "$2" 2>&1 | \ - perl -ne 'printf("%s %-10s %s\n",$2,$1,$3) if /OCC::(.*?) created for "(.*?)" . "(.*?)" "(.*?)"/' + perl -ne 'BEGIN{$v=shift @ARGV };printf("%s %-10s %s\n",$2,$1,$3) if $v and /OCC::(.*?) created for "(.*?)" . "(.*?)" "(.*?)"/' "$VERBOSE" return 0 } @@ -121,13 +121,16 @@ owncloud_all() { user=`ls -ld "$dir" |awk '{print $3}'` cd "$dir" || continue - [ "$VERBOSE" -gt 0 ] && echo "$user: $dir" + #[ "$VERBOSE" -gt 0 ] && echo "$user: $dir" args="" + [ "$VERBOSE" -gt 0 ] && args="$args --verbose" if [ "$DEBUG" -gt 0 ]; then echo su - "$user" -c "${NAME}${args}" + continue fi - su - "$user" -c "${NAME}${args}" | sed "s/^/$user /" + + su - "$user" -c "${NAME}${args}" | sed "s~^~$user:$dir ~" done } -- 2.47.3