Fix some errors syncunf nextclud accounts..
This commit is contained in:
@@ -20,7 +20,7 @@ err_Log=${LOCK_DIR}/nc_account.err.log
|
||||
|
||||
backup_base_target_dir="${backup_mirror_dir}/Nextcloud-Accounts"
|
||||
backup_target_dir="${backup_base_target_dir}/${nc_server_name}/${nc_user}"
|
||||
nc_params="--non-interactive --silent"
|
||||
#nc_params="--non-interactive --silent"
|
||||
nc_params="--non-interactive"
|
||||
|
||||
if [[ ! -d "$backup_base_target_dir" ]] ; then
|
||||
@@ -40,13 +40,6 @@ if [[ ! -d "$backup_target_dir" ]] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
#echo "server url: $nc_server_url"
|
||||
#echo "server name: $nc_server_name"
|
||||
#echo "user: $nc_user"
|
||||
#echo "password: $nc_password"
|
||||
#
|
||||
#exit 0
|
||||
|
||||
nc_cmd_bin="$(which nextcloudcmd)"
|
||||
|
||||
if [ -z "$nc_cmd_bin" ]; then
|
||||
@@ -64,10 +57,10 @@ if $MIRROR ; then
|
||||
b_timestamp="$(date +"%s")"
|
||||
|
||||
echo ""
|
||||
echo "$nc_cmd_bin $nc_params -u $nc_user -p $nc_password $backup_target_dir $nc_server_url"
|
||||
echo "$nc_cmd_bin $nc_params -u $nc_user -p \"$nc_password\" $backup_target_dir $nc_server_url"
|
||||
echo ""
|
||||
$(
|
||||
$nc_cmd_bin $nc_params -u $nc_user -p $nc_password $backup_target_dir $nc_server_url > $err_Log 2>&1
|
||||
$nc_cmd_bin $nc_params -u $nc_user -p "$nc_password" $backup_target_dir $nc_server_url > $err_Log 2>&1
|
||||
exit $?
|
||||
)
|
||||
retval=$?
|
||||
@@ -95,12 +88,15 @@ if $MIRROR ; then
|
||||
## - look about errors..
|
||||
## -
|
||||
if [ "$retval" != "0" ]; then
|
||||
cp -a "$err_Log" "/var/log/nc_account-${nc_user}.err.log"
|
||||
if grep -i -q -E "Authentication\s+failed" "$err_Log" 2> /dev/null ; then
|
||||
echo "Authentication failed for user \"$nc_user\" on system \"$nc_server_name\".." > "$err_Log"
|
||||
print_error_stdout "Authentication failed for user \"$nc_user\" on system \"$nc_server_name\""
|
||||
echolog "\t[ERROR] Authentication failed for user \"$nc_user\".. [ $duration ]"
|
||||
else
|
||||
print_error_stdout "Cannot backup netxcloud account \"$nc_user\""
|
||||
echolog "\t[ Notice ] Errors occured while syncing files from netxcloud account \"$nc_user\" [ $duration ]"
|
||||
fi
|
||||
|
||||
print_error_stdout "Cannot backup netxcloud account \"$nc_user\"\n $(cat "$err_Log")"
|
||||
echolog "\t[ERROR] Cannot Cannot backup netxcloud account \"$nc_user\" [ $duration ]\n\t`$cat $err_Log`\n"
|
||||
else
|
||||
|
||||
## - print durations right-aligned
|
||||
|
||||
Reference in New Issue
Block a user