kapitainsky / RcloneBrowser

Simple cross platform GUI for rclone. Supports macOS, GNU/Linux, BSD family and Windows.
https://github.com/kapitainsky/RcloneBrowser
MIT License
2.37k stars 222 forks source link

Generate error log in real time? #233

Open swswsws583 opened 8 months ago

swswsws583 commented 8 months ago

Hi, is there a way I can know what file(s) is/are shown as error in the output box? Is it possible to automatically generate a log of errors with the location path specified as the transfer goes on? Thanks!

What I can see in the output box now: Errors: 1 (retrying may help)

Gussak commented 7 months ago

Hi! I find it difficult to see what is going on too, so I implemented this for linux (you may be able to patch it and run it in cygwin too if you need). Your specific request can be a filter in the while loop in the end, I havent seen it happen before so I would need some log to implement it.

cat >rcloneLogMakeReadable.sh; chmod +x rcloneLogMakeReadable.sh; ./rcloneLogMakeReadable.sh

#!/bin/bash

clear;

#read -p "paste rclone log at /tmp/rclone.log"

strCmd='/usr/bin/rclone copy --update --verbose --transfers 4 --checkers 8 --contimeout 60s --timeout 300s --retries 3 --low-level-retries 10 --stats 1s --stats-file-name-length 0 --fast-list "/'"$HOME"'/Google Drive/" remote:rclone/ 2>&1 |tee /tmp/rclone.log'
echo "$strCmd"

echo "running the above command (that was copied from a job from rclone-browser) in gnome-terminal"
gnome-terminal -- bash -c "$strCmd;read -p exit"

while true;do
    clear
    cat /tmp/rclone.log |egrep "^.*INFO  :" |egrep -v ".*: $" |sort
    cat /tmp/rclone.log |egrep "^ [*] " |tail -n 1
    sleep 1
done

output ex.:

2024/04/23 22:04:06 INFO  : somepath/somefile.txt: Updated modification time in destination
2024/04/23 22:04:07 INFO  : somepath2/somefile2.txt: Copied (replaced existing)
 * somepath3/somefile3.txt:100% /21.021Mi, 1.454Mi/s, 0s

PS.: The above log filter could be an alternative console log box inside rclone-browser, would be nice!