Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-07-17 00:29 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (353 votes). Check out past polls.