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

Anyone using gsutil?

by johnfl68 (Scribe)
on Mar 09, 2013 at 23:04 UTC ( [id://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

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://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-24 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found