pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedShell Script for Vacuum
10+ messages / 6 participants
[nested] [flat]
* Shell Script for Vacuum
@ 2013-07-29 07:17 Manish Kediyal <kediyal.manish@gmail.com>
0 siblings, 2 replies; 10+ messages in thread
From: Manish Kediyal @ 2013-07-29 07:17 UTC (permalink / raw)
To: pgsql-admin
Hi,
I have various DB in my DB cluster, i want to vacuum all DB's using a shell
script...... scheduling via cron.
It would be a great help if anyone could provide me a Shell Script to
vacuum all DB's
Thanks and Regards
Manish Kediyal
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2013-07-29 07:26 raghu ram <raghuchennuru@gmail.com>
parent: Manish Kediyal <kediyal.manish@gmail.com>
1 sibling, 2 replies; 10+ messages in thread
From: raghu ram @ 2013-07-29 07:26 UTC (permalink / raw)
To: Manish Kediyal <kediyal.manish@gmail.com>; +Cc: pgsql-admin
On Mon, Jul 29, 2013 at 12:47 PM, Manish Kediyal
<kediyal.manish@gmail.com>wrote:
> Hi,
>
> I have various DB in my DB cluster, i want to vacuum all DB's using a
> shell script...... scheduling via cron.
> It would be a great help if anyone could provide me a Shell Script to
> vacuum all DB's
>
>
>
>
> You can perform vacuum for all databases available in PostgreSQL Instance
using "vacuumdb" utility and Command as follows:
/opt/PostgreSQL/9.2/bin/vacuumdb -a -z -v >> /tmp/vacuumanalyze.log 2>>
/tmp/vacuumanalyze.log
Thanks & Regards
Raghu Ram
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2013-07-29 07:37 Manish Kediyal <kediyal.manish@gmail.com>
parent: raghu ram <raghuchennuru@gmail.com>
1 sibling, 1 reply; 10+ messages in thread
From: Manish Kediyal @ 2013-07-29 07:37 UTC (permalink / raw)
To: raghu ram <raghuchennuru@gmail.com>; +Cc: pgsql-admin
Thanks Raghu,
Is there a shell script for it, i wanna scheduled that through cron.
Thanks
Manish
On Mon, Jul 29, 2013 at 12:56 PM, raghu ram <raghuchennuru@gmail.com> wrote:
> On Mon, Jul 29, 2013 at 12:47 PM, Manish Kediyal <kediyal.manish@gmail.com
> > wrote:
>
>> Hi,
>>
>> I have various DB in my DB cluster, i want to vacuum all DB's using a
>> shell script...... scheduling via cron.
>> It would be a great help if anyone could provide me a Shell Script to
>> vacuum all DB's
>>
>>
>>
>>
>> You can perform vacuum for all databases available in PostgreSQL Instance
> using "vacuumdb" utility and Command as follows:
>
> /opt/PostgreSQL/9.2/bin/vacuumdb -a -z -v >> /tmp/vacuumanalyze.log 2>>
> /tmp/vacuumanalyze.log
>
> Thanks & Regards
> Raghu Ram
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2013-07-29 08:04 raghu ram <raghuchennuru@gmail.com>
parent: Manish Kediyal <kediyal.manish@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: raghu ram @ 2013-07-29 08:04 UTC (permalink / raw)
To: Manish Kediyal <kediyal.manish@gmail.com>; +Cc: pgsql-admin
On Mon, Jul 29, 2013 at 1:07 PM, Manish Kediyal <kediyal.manish@gmail.com>wrote:
> Thanks Raghu,
>
> Is there a shell script for it, i wanna scheduled that through cron.
>
>
You can create below Script for scheduling purpose:
#!/bin/bash
PGHOME=/opt/PostgreSQL/9.2/bin
LOG=/Backup/cron-script-logs
LOGFILE=vacuum_analyze_`date +"%Y-%m-%d-%T"`.log
$PGHOME/vacuumdb -a -z -v >> $LOG/$LOGFILE 2>> $LOG/$LOGFILE
Thanks & Regards
Raghu Ram
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2013-07-29 08:08 Manish Kediyal <kediyal.manish@gmail.com>
parent: raghu ram <raghuchennuru@gmail.com>
0 siblings, 0 replies; 10+ messages in thread
From: Manish Kediyal @ 2013-07-29 08:08 UTC (permalink / raw)
To: raghu ram <raghuchennuru@gmail.com>; +Cc: pgsql-admin
Thanks Raghu,
On Mon, Jul 29, 2013 at 1:34 PM, raghu ram <raghuchennuru@gmail.com> wrote:
>
> On Mon, Jul 29, 2013 at 1:07 PM, Manish Kediyal <kediyal.manish@gmail.com>wrote:
>
>> Thanks Raghu,
>>
>> Is there a shell script for it, i wanna scheduled that through cron.
>>
>>
> You can create below Script for scheduling purpose:
>
> #!/bin/bash
> PGHOME=/opt/PostgreSQL/9.2/bin
> LOG=/Backup/cron-script-logs
> LOGFILE=vacuum_analyze_`date +"%Y-%m-%d-%T"`.log
>
> $PGHOME/vacuumdb -a -z -v >> $LOG/$LOGFILE 2>> $LOG/$LOGFILE
>
> Thanks & Regards
> Raghu Ram
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2013-07-29 16:31 Thomas Kellerer <spam_eater@gmx.net>
parent: Manish Kediyal <kediyal.manish@gmail.com>
1 sibling, 1 reply; 10+ messages in thread
From: Thomas Kellerer @ 2013-07-29 16:31 UTC (permalink / raw)
To: pgsql-admin
Manish Kediyal wrote on 29.07.2013 09:17:
> I have various DB in my DB cluster, i want to vacuum all DB's using a shell script...... scheduling via cron.
> It would be a great help if anyone could provide me a Shell Script to vacuum all DB's
>
Is there a specific reason you don't want to use auto-vacuum or tune it to suit your needs?
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2013-07-30 04:41 Manish Kediyal <kediyal.manish@gmail.com>
parent: Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 0 replies; 10+ messages in thread
From: Manish Kediyal @ 2013-07-30 04:41 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-admin
Hi Thomas,
I am aware of of tht above 9.0 thr is default
auto-vacuuming.............but I just want to tune according to my
needs......
On Mon, Jul 29, 2013 at 10:01 PM, Thomas Kellerer <spam_eater@gmx.net>wrote:
> Manish Kediyal wrote on 29.07.2013 09:17:
>
> I have various DB in my DB cluster, i want to vacuum all DB's using a
>> shell script...... scheduling via cron.
>> It would be a great help if anyone could provide me a Shell Script to
>> vacuum all DB's
>>
>>
> Is there a specific reason you don't want to use auto-vacuum or tune it to
> suit your needs?
>
>
>
>
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-admin<http://www.postgresql.org/mailpref/pgsql-admin;
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2014-11-21 13:23 rajivmehta0201 <rajivmehta0201@gmail.com>
parent: raghu ram <raghuchennuru@gmail.com>
1 sibling, 2 replies; 10+ messages in thread
From: rajivmehta0201 @ 2014-11-21 13:23 UTC (permalink / raw)
To: pgsql-admin
Hi,
I am running this script but it giving error.
vacuumdb: could not connect to database postgres: could not connect to
server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Can you please help me on this?
--
View this message in context: http://postgresql.nabble.com/Shell-Script-for-Vacuum-tp5765414p5827854.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2014-11-22 11:49 Raghavendra <raghavendra.rao@enterprisedb.com>
parent: rajivmehta0201 <rajivmehta0201@gmail.com>
1 sibling, 0 replies; 10+ messages in thread
From: Raghavendra @ 2014-11-22 11:49 UTC (permalink / raw)
To: rajivmehta0201 <rajivmehta0201@gmail.com>; +Cc: pgsql-admin
On Fri, Nov 21, 2014 at 4:23 PM, rajivmehta0201 <rajivmehta0201@gmail.com>
wrote:
> Hi,
>
> I am running this script but it giving error.
>
> vacuumdb: could not connect to database postgres: could not connect to
> server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
>
> Can you please help me on this?
>
>
Check Postgres Server running or not ?
If running, check on which port its running ?
Accordingly edit the script and place below environment variables, then
call the script.
PGUSER=postgres
PGPORT=5432 ## Give the port on which your server running
---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Shell Script for Vacuum
@ 2014-11-22 17:51 Craig James <cjames@emolecules.com>
parent: rajivmehta0201 <rajivmehta0201@gmail.com>
1 sibling, 0 replies; 10+ messages in thread
From: Craig James @ 2014-11-22 17:51 UTC (permalink / raw)
To: rajivmehta0201 <rajivmehta0201@gmail.com>; +Cc: pgsql-admin
On Fri, Nov 21, 2014 at 5:23 AM, rajivmehta0201 <rajivmehta0201@gmail.com>
wrote:
> Hi,
>
> I am running this script but it giving error.
>
> vacuumdb: could not connect to database postgres: could not connect to
> server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
>
> Can you please help me on this?
>
>
Try using the server's name rather than "localhost" or the default, for
example:
psql -U postgres -h myservername
If that works, it means your pg_hba.conf isn't configured correctly for
"localhost".
Craig
>
>
>
> --
> View this message in context:
> http://postgresql.nabble.com/Shell-Script-for-Vacuum-tp5765414p5827854.html
> Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2014-11-22 17:51 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-07-29 07:17 Shell Script for Vacuum Manish Kediyal <kediyal.manish@gmail.com>
2013-07-29 07:26 ` raghu ram <raghuchennuru@gmail.com>
2013-07-29 07:37 ` Manish Kediyal <kediyal.manish@gmail.com>
2013-07-29 08:04 ` raghu ram <raghuchennuru@gmail.com>
2013-07-29 08:08 ` Manish Kediyal <kediyal.manish@gmail.com>
2014-11-21 13:23 ` rajivmehta0201 <rajivmehta0201@gmail.com>
2014-11-22 11:49 ` Raghavendra <raghavendra.rao@enterprisedb.com>
2014-11-22 17:51 ` Craig James <cjames@emolecules.com>
2013-07-29 16:31 ` Thomas Kellerer <spam_eater@gmx.net>
2013-07-30 04:41 ` Manish Kediyal <kediyal.manish@gmail.com>
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