STDOUT and STDERR logs are written to same file

Hi,

I want STDOUT logs to be written to one file and STDERR logs to be written to another file. I use below command to sync to google drive

rclone sync /storage/backup/week2 gdrive:backup/weekly -l --backup-dir gdrive:backup/incremental/date +%Y-%m-%d -c --fast
-list --tpslimit 20 --log-level INFO --stats 0 1>/tmp/rclone.log 2>/tmp/rclone-error.log

All rclone logs are written to /tmp/rclone-error.log. Why this is happening.

I want STDOUT logs to be written to one file and STDERR logs to be written to another file. how can i achieve this.

I think what you have written does exactly that. Rclone only logs to STDERR normally.

What output do you want in the /tmp/rclone.log file?

STDOUT log file (/tmp/rclone.log) is emtpy and all INFO logs are written to STDERR log file(/tmp/rclone-error.log).

Infact i want rclone to write all INFO logs to STDOUT log file (/tmp/rclone.log) and if there is any error during rclone sync i want those error logs to be written to STDERR log file(/tmp/rclone-error.log).

Is there any option to print stats only at end of sync and not every 1 minutes, 5 minutes or any other time.

I want below kind of stats to be printed only at end of sync

Transferred: 137 / 137 Bytes, 100%, 4 Bytes/s, ETA 0s
Errors: 0
Checks: 4744 / 4744, 100%
Transferred: 1 / 1, 100%
Elapsed time: 31.5s

If you set the stats interval to very large that will have the same effect, eg --stats 99d

I tried below command

rclone sync /storage/backup/week2 gdrive:backup/weekly -l --backup-dir gdrive:backup/incremental/date +%Y-%m-%d -c --fast-list --tpslimit 20 --log-level INFO --stats 99d 1>/tmp/rclone.log 2>/tmp/rclone-error.log

and now i have below error

Error: invalid argument β€œ99d” for β€œβ€“stats” flag: time: unknown unit d in duration 99d

I solved this by specifying below command

rclone sync /storage/backup/week2 gdrive:backup/weekly -l --backup-dir gdrive:backup/incremental/date +%Y-%m-%d -c --fast-list --tpslimit 20 --log-level INFO --stats 129600m 1>/tmp/rclone.log 2>/tmp/rclone-error.log

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.