Re: Creating Log file - run in background.

From: John Burski <John(dot)Burski(at)911ep(dot)com>
To: Sterling <smullett(at)omeninc(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Creating Log file - run in background.
Date: 2000-12-14 15:24:53
Message-ID: 3A38E645.D515FEA0@911ep.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

It looks like the "> >" between the "-D" (postmaster command line option) and the
"/usr/local/pgsql/data" filename are continuations in your e-mail window.

The ">>" between the "/dev/null" filename and the "/user/local/.../server.log"
filename are meant to redirect the output to stdout (standard output, usually the
screen) and append it the file name that follows, in this case
"/usr/local/.../server.log".

Here's what the command is supposed to do:

nohup - Execute the following command, making it immune to "hangups" and
with output to a non-tty device.

/usr/local/.../postmaster -D /usr/local/pgsql/data - Execute the postmaster
program, using /usr/local/pgsql/data directory as the root of the tree of
database directories.

< /dev/null - Input is redirected from the bit-bucket. (Don't ask me why -
I've not looked closely enough at the nitty-gritty to understand that yet).

>> /usr/local/pgsql/data/server.log - Redirect anything output to stdout to
this file.

2>>1 - Redirect and append anything output to stderr to stdout. This
causes both stdout and stderr to be logged in the same file

& - Run in the background.

Hope that helps.

Regards.

Sterling wrote:

> H-
>
> Ok. So the new command should look like this.
>
> nohup /usr/local/pgsql/bin/postmaster -D > >/usr/local/pgsql/data </dev/null
> >>/usr/local/pgsql/data/server.log 2>>1 &
>
> What are the > > 's for? Are they acting as ( ) 's like in perl or some other
> language?
>
> If so should they match? I'm getting lost in the > > and can't figure out if the >
> > is actually in the command or part of the wrapping for my window terminal (it
> stays when I resize the window so...) or from my email client when it copies the
> original post.
>
> Thanks for all your help and replies. I just need to get up to speed on what
> you're telling me. 8^)
> -Sterling
>
> Tom Lane wrote:
>
> > >> Should the command look like this than:
> > >> nohup /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data/server.log &
> >
> > > That should work, yep.
> >
> > Uh, nope.
> >
> > That will try to use /usr/local/pgsql/data/server.log as a directory.
> >
> > Your original advice was better.
> >
> > regards, tom lane

--
John Burski
Chief IT Cook and Bottlewasher
911 Emergency Products, St. Cloud, MN
(320) 656 0076

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message juerg.rietmann 2000-12-14 15:29:45
Previous Message Oliver Elphick 2000-12-14 13:02:22 Re: passwords