From: Nicolas Boisselier Date: Thu, 8 Sep 2016 19:14:04 +0000 (+0200) Subject: bin/owncloud-sync X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a72855200267fa484422ca90f3b71f3423213616;p=nb.git bin/owncloud-sync --- 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 }