Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Anyone using gsutil?

by johnfl68 (Beadle)
on Mar 09, 2013 at 23:04 UTC ( #1022628=perlquestion: print w/replies, xml ) Need Help??
johnfl68 has asked for the wisdom of the Perl Monks concerning the following question:

Anyone using Google's GSUTIL in Perl?

How did you handle suppressing output for standard operations?

I have this for example:

$cmd = "gsutil cp -a public-read $localfile gs:// +irectory/$filehash.png"; system $cmd;

With S3CMD (for Amazon S3) I just added ">/dev/null" to the end of the command line, and then I only get warnings. However with GSUTIL, doing so I still get the same output from the script every time it is run.

Google's GSUTIL is still fairly new, so in searching I haven't found much on people using this in perl scripts, so I thought I would post here to see if anyone has had any experiences with this.



Replies are listed 'Best First'.
Re: Anyone using gsutil?
by Anonymous Monk on Mar 09, 2013 at 23:44 UTC

      Thanks for the Capture::Tiny suggestion.

      Actually, I just found a what seems to be unpublished option for GSUTIL that works for only the cp command. There is a -q switch. Why this isn't better documented, I don't know.

      So, you can use this:

      $cmd = "gsutil cp -q -a public-read $localfile gs:// +mpdirectory/$filehash.png"; system $cmd;

      And you will not get output. I still am not sure if this will output warning dialog though, if there was a issue.

      Unfortunately it only works with the cp (copy) and not other commands like rm.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1022628]
Approved by toolic
Corion resurfaces. I find the Canary Islands always relaxing, at least for 7 days :)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-02-21 20:15 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (287 votes). Check out past polls.