Thread: Shell Script for Vacuum
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
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
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'sYou 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.logThanks & RegardsRaghu Ram
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
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/bashPGHOME=/opt/PostgreSQL/9.2/binLOG=/Backup/cron-script-logsLOGFILE=vacuum_analyze_`date +"%Y-%m-%d-%T"`.log$PGHOME/vacuumdb -a -z -v >> $LOG/$LOGFILE 2>> $LOG/$LOGFILEThanks & RegardsRaghu Ram
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?
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:Is there a specific reason you don't want to use auto-vacuum or tune it to suit your needs?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
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/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.
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
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 OfficerCraig A. James