How to register with gsutil rsync

How can any errors or warnings be logged while performing silent rsync?

This is what I am currently running from my crontab:

gsutil -m -q rsync -r -C /mount1/share/folder gs://my-bucket-1/folder/ > /mount2/share/folder/gsutil.log

      

Since the log file is always completely empty and I am downloading terabytes of data, I am starting to think that perhaps even errors and warnings are being suppressed.

+3


source to share


1 answer


Once you figured out that this has to do with how you waste stdout and / or stderr on files in general, the answer really lies in this existing stream: How to redirect both stdout and stderr to a file

So a simple solution to log as much as possible in a single log file might look something like this:



gsutil -d rsync [src] [dst] &> [logfile]

      

... where -d

enables debug output. I found that this is the only way to show files that were affected by the error, eg CommandException: 3 files/objects could not be copied

. Note that it -d

provides authentication details.

+3


source







All Articles