Problem to redirect rclone logs


#1

I’m trying to get only some information about summary from rclone log, but grep doesn’t work.

root@bacula:~# rclone copyto /root/.config/rclone/rclone.conf dropbox:/rclone/rclone.conf --stats=1000m --log-level INFO | grep "Checks"
2018/05/16 08:54:53 INFO  : Dropbox root 'rclone': Modify window is 1s
2018/05/16 08:54:53 INFO  :
Transferred:      0 Bytes (0 Bytes/s)
Errors:                 0
Checks:                 1
Transferred:            0
Elapsed time:        1.2s

How to do this?

Best regards
Wanderlei


#2

rclone is using stderr for log output by default.

You can use shell redirects to grep it:

rclone copyto /root/.config/rclone/rclone.conf dropbox:/rclone/rclone.conf --stats=1000m --log-level INFO 2>&1 | grep "Checks"