Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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://g3.mydomain.com/tempd +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.

Thanks!

John

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://g3.mydomain.com/te +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.

      John

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1022628]
Approved by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (19)
As of 2014-12-18 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls