From: Murthy Nunna <mnunna@fnal.gov>
To: SOzcn <selahattinozcnma@gmail.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: RE: Timestamps in outputs
Date: Sun, 24 Dec 2023 15:36:27 +0000
Message-ID: <DM8PR09MB66778CAAF165DC2BBCBA017BB89AA@DM8PR09MB6677.namprd09.prod.outlook.com> (raw)
In-Reply-To: <CAJyV5AbTtUck6hw8M090xVT10_2okpam1mfFfGjH548e4NbY5g@mail.gmail.com>
References: <DM8PR09MB667741AF88688CC950B47596B897A@DM8PR09MB6677.namprd09.prod.outlook.com>
<CAJyV5AbTtUck6hw8M090xVT10_2okpam1mfFfGjH548e4NbY5g@mail.gmail.com>
Thanks, SOzcn!
Just for the record…. If you don’t have “ts” installed in your server (like mine), you can do the following as sell. I got this solution from a Linux forum. There are number of alternatives, but I find this one simpler.
<your-script-or-command> | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0; fflush() }' > t.txt &
Thanks!
From: SOzcn <selahattinozcnma@gmail.com>
Sent: Wednesday, December 20, 2023 12:15 AM
To: Murthy Nunna <mnunna@fnal.gov>
Cc: pgsql-admin@postgresql.org
Subject: Re: Timestamps in outputs
Hello, next to your linux command you can get output like ; pg_restore - ... - ... 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' > pg_restore_output.log
Murthy Nunna <mnunna@fnal.gov<mailto:mnunna@fnal.gov>>, 20 Ara 2023 Çar, 02:08 tarihinde şunu yazdı:
Hi,
I am running pg_restore on a large (~20TB) database. I am using -V flag. Is there a way I can get timestamps in front of each line that is logged in the output.
pg_restore: launching item 5470 INDEX ….
pg_restore: creating INDEX ….
pg_restore: finished item 6131 TABLE DATA …
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mnunna@fnal.gov, selahattinozcnma@gmail.com
Subject: RE: Timestamps in outputs
In-Reply-To: <DM8PR09MB66778CAAF165DC2BBCBA017BB89AA@DM8PR09MB6677.namprd09.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox