Assuming s3cmd handles errors correctly error messages will be sent to
stderror and it will exit with a non zero exit status. I would test that
that is the case and use the exit status to check for errors, direct stdout
to /dev/null and capture stderr to your log.
Most often for a properly written command line tool the way to do what you
want is to direct stdout to null, capture stderr, and check the exit
status.
On Dec 19, 2012 1:28 AM, "John Birchman" <johnr...@gmail.com> wrote:
> Andi and others:
>
> With other command line tools, there is usually a "warnings only"
> switch, in which the output is suppressed when things are normal, but if
> a problem occurs, then it will respond with the problem.
>
> For example, ffmpeg has the -loglevel switch, which can be set to
> 'quiet' 'warning' 'verbose' etc. based on the amount of output you want
> returned, if any.
>
> Yes, I can send the responses to null, but then I would never know if
> there was a problem. I could look at the responses, and add a
> conditional for a warning alert, but I do not know all of the possible
> warning responses from s3cmd. Like I said, most command line tools
> already have a warnings only switch for this reason.
>
> I guess I am going to give on on using s3cmd for now, since there does
> not seem to be a warnings only option, which is unfortunate, as I like
> many of the things it does over some of the other s3 tools. Perhaps the
> author will add this option in the future.
>
> John
>
> On 12/14/2012 4:57 PM, Andi Everitt wrote:
> > Hi John,
> >
> > I'm not sure exactly what you're asking. I don't use put routinely but I
> > do use sync in a script to run in the middle of the night and there I
> > catch the output to log files. If you don't want output can you just
> > direct it to /dev/nul?
> >
> > Kind Regards,
> > Andi
> >
> > On 12/12/2012 16:34, John Birchman wrote:
> >> Hello:
> >>
> >> (sorry if this is a duplicate message - I have not revived any messages
> >> from this list since I joined, including my first message that I should
> >> have seen echoed back.)
> >>
> >> I am trying to use s3cmd from within perl using system.
> >>
> >> What is the switch to suppress the response dialog that comes back for
> >> every put request?
> >>
> >> I have tried:
> >>
> >> --no-progress
> >>
> >> but that doesn't seem to change anything.
> >>
> >> Also I there is nothing to say exactly where to put it, though I tried
> >> different places. Do you put it after the s3cmd? Or at the end?
> >>
> >> I would like to use this, but if I am going to have the script/cron
> >> email me every minute to tell me that it uploaded the file correctly,
> >> I'm not going to use it, because it is really annoying.
> >>
> >> I only want warning messages to be displayed, if everything worked ok, I
> >> want no response.
> >>
> >> Thanks for any help!
> >>
> >> John
> >>
> >>
> ------------------------------------------------------------------------------
> >> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> >> Remotely access PCs and mobile devices and provide instant support
> >> Improve your efficiency, and focus on delivering more value-add services
> >> Discover what IT Professionals Know. Rescue delivers
> >> http://p.sf.net/sfu/logmein_12329d2d
> >> _______________________________________________
> >> S3tools-general mailing list
> >> S3tools-general@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/s3tools-general
> >
> >
> ------------------------------------------------------------------------------
> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> > Remotely access PCs and mobile devices and provide instant support
> > Improve your efficiency, and focus on delivering more value-add services
> > Discover what IT Professionals Know. Rescue delivers
> > http://p.sf.net/sfu/logmein_12329d2d
> > _______________________________________________
> > S3tools-general mailing list
> > S3tools-general@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/s3tools-general
> >
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> S3tools-general mailing list
> S3tools-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/s3tools-general
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
S3tools-general mailing list
S3tools-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/s3tools-general