Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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.



Comment on Anyone using gsutil?
Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (16)
As of 2015-05-26 16:50 GMT
Find Nodes?
    Voting Booth?

    In my home, the TV remote control is ...

    Results (508 votes), past polls