When using rclone copy
or rclone copyto
, I want to have a one line output that includes the file that is being considered and if copy/copyto decides it needs to be updated or if it is the same and doesn't need to be updated.
I've tried adding --stats-one-line
and it although it does seem to compress to one line of text, it seems to add a blank line (I discovered the blank line is for the operations.go
line when the file is not needed to be copied - see below my code and output I added to this post) after each line of output so for each file there are two lines created in the log (one blank).
Also, how can I just show the filename of the file being worked on and not the .go filename where the code is executing? When I try to change --log-format shortfile,date,time
ex: 2021/03/09 09:46:07 stats.go:368: INFO
the "stats.go:368" (or "operations.go:477") is a reference to the code that is executing and has nothing to do with the file being worked on... and it is unexpected from the --log-format
option description to see that code reference.
Maybe this is really two questions? Ultimately I would like to see output similar to rclone sync
when using rclone copy
or rclone copyto
Here is my command line: rclone copy -v --log-format shortfile,date,time --stats-one-line --log-file /srv/logs/${CONFIG_CODE}.log ${downloaded_path} ${fileserver_dir}
rclone --version
rclone v1.51.0
- os/arch: linux/amd64
- go version: go1.13.7
I notice that -stats-one-line
I am using is actually documented as a flag to use with --progress
even though I am not using --progress
, maybe that is why I am getting two lines unexpectedly?
and below is a snippet of output... I don't need the "progress output as the second line, I just want the filename and the status of what happened (i.e. Copied (replaced existing)
)
2021/03/09 14:49:47 operations.go:477: INFO : acme_discounts.zip: Copied (replaced existing)
2021/03/09 14:49:47 stats.go:368: INFO : 5.540k / 5.540 kBytes, 100%, 8.265 MBytes/s, ETA 0s
2021/03/09 14:49:47 operations.go:477: INFO : acme_blue_orders.zip: Copied (replaced existing)
2021/03/09 14:49:47 stats.go:368: INFO : 1.983M / 1.983 MBytes, 100%, 183.183 MBytes/s, ETA 0s
2021/03/09 14:49:49 operations.go:477: INFO : acme_inventory.zip: Copied (replaced existing)
2021/03/09 14:49:49 stats.go:368: INFO : 28.131M / 28.131 MBytes, 100%, 399.907 MBytes/s, ETA 0s
2021/03/09 14:49:50 stats.go:368: INFO : 0 / 0 Bytes, -, 0 Bytes/s, ETA -
2021/03/09 14:49:50 stats.go:368: INFO : 0 / 0 Bytes, -, 0 Bytes/s, ETA -
2021/03/09 14:49:52 stats.go:368: INFO : 0 / 0 Bytes, -, 0 Bytes/s, ETA -
2021/03/09 14:49:52 stats.go:368: INFO : 0 / 0 Bytes, -, 0 Bytes/s, ETA -
2021/03/09 14:49:53 stats.go:368: INFO : 0 / 0 Bytes, -, 0 Bytes/s, ETA -
2021/03/09 14:49:54 stats.go:368: INFO : 0 / 0 Bytes, -, 0 Bytes/s, ETA -
2021/03/09 14:49:51 operations.go:477: INFO : acme_green_orders.zip: Copied (replaced existing)
2021/03/09 14:49:51 stats.go:368: INFO : 4.547M / 4.547 MBytes, 100%, 330.929 MBytes/s, ETA 0s
2021/03/09 14:49:52 operations.go:477: INFO : acme_red_orders.zip: Copied (replaced existing)
2021/03/09 14:49:52 stats.go:368: INFO : 7.817M / 7.817 MBytes, 100%, 35.990 MBytes/s, ETA 0s