Re: vacuumdb seems not to like option -j when run from crontab
8.4 does not support -j On Mon, Dec 4, 2023 at 8:22 AM Ron Johnson wrote: > (Sorry for top-posting. Blame gmail.) > > Turns out that PG 8.4.20 is also installed from the RHEL repository. > > Thanks. > > On Mon, Dec 4, 2023 at 11:13 AM Alan Hodgson > wrote: > >> On Mon, 2023-12-04 at 11:07 -0500, Ron Johnson wrote: >> >> PG 9.6.24 (Yes, it's EOL.) >> >> When running "vacuumdb -p5433 -j4 --analyze tap_d" from a bash prompt, it >> works as expected: >> $ vacuumdb -p5433 -j4 --analyze tap_d >> vacuumdb: vacuuming database "tap_d" >> >> But not when running from crontab: >> vacuumdb -p5433 -j4 --analyze tap_d >> vacuumdb: invalid option -- 'j' >> Try "vacuumdb --help" for more information. >> >> Obviously I'm missing something, but don't see what it is. Attached is >> the script it runs from. >> >> >> Is your user and PATH the same? ie. are you running the same vacuumdb >> executable? >> >>
Re: vacuumdb seems not to like option -j when run from crontab
(Sorry for top-posting. Blame gmail.) Turns out that PG 8.4.20 is also installed from the RHEL repository. Thanks. On Mon, Dec 4, 2023 at 11:13 AM Alan Hodgson wrote: > On Mon, 2023-12-04 at 11:07 -0500, Ron Johnson wrote: > > PG 9.6.24 (Yes, it's EOL.) > > When running "vacuumdb -p5433 -j4 --analyze tap_d" from a bash prompt, it > works as expected: > $ vacuumdb -p5433 -j4 --analyze tap_d > vacuumdb: vacuuming database "tap_d" > > But not when running from crontab: > vacuumdb -p5433 -j4 --analyze tap_d > vacuumdb: invalid option -- 'j' > Try "vacuumdb --help" for more information. > > Obviously I'm missing something, but don't see what it is. Attached is > the script it runs from. > > > Is your user and PATH the same? ie. are you running the same vacuumdb > executable? > >
Re: vacuumdb seems not to like option -j when run from crontab
Add a pg binary path to script br Kaido On Mon, 4 Dec 2023 at 18:13, Alan Hodgson wrote: > On Mon, 2023-12-04 at 11:07 -0500, Ron Johnson wrote: > > PG 9.6.24 (Yes, it's EOL.) > > When running "vacuumdb -p5433 -j4 --analyze tap_d" from a bash prompt, it > works as expected: > $ vacuumdb -p5433 -j4 --analyze tap_d > vacuumdb: vacuuming database "tap_d" > > But not when running from crontab: > vacuumdb -p5433 -j4 --analyze tap_d > vacuumdb: invalid option -- 'j' > Try "vacuumdb --help" for more information. > > Obviously I'm missing something, but don't see what it is. Attached is > the script it runs from. > > > Is your user and PATH the same? ie. are you running the same vacuumdb > executable? > >
Re: vacuumdb seems not to like option -j when run from crontab
On Mon, 2023-12-04 at 11:07 -0500, Ron Johnson wrote: > PG 9.6.24 (Yes, it's EOL.) > > When running "vacuumdb -p5433 -j4 --analyze tap_d" from a bash > prompt, it works as expected: > $ vacuumdb -p5433 -j4 --analyze tap_d > vacuumdb: vacuuming database "tap_d" > > But not when running from crontab: > vacuumdb -p5433 -j4 --analyze tap_d > vacuumdb: invalid option -- 'j' > Try "vacuumdb --help" for more information. > > Obviously I'm missing something, but don't see what it is. > Attached is the script it runs from. > Is your user and PATH the same? ie. are you running the same vacuumdb executable?
vacuumdb seems not to like option -j when run from crontab
PG 9.6.24 (Yes, it's EOL.) When running "vacuumdb -p5433 -j4 --analyze tap_d" from a bash prompt, it works as expected: $ vacuumdb -p5433 -j4 --analyze tap_d vacuumdb: vacuuming database "tap_d" But not when running from crontab: vacuumdb -p5433 -j4 --analyze tap_d vacuumdb: invalid option -- 'j' Try "vacuumdb --help" for more information. Obviously I'm missing something, but don't see what it is. Attached is the script it runs from. #!/bin/bash ActionLabel=VACUUM echo; date +"%n%F %T TIMEIT $ActionLabel started."; echo START_SECS=$(date +"%s") set -x vacuumdb -p5433 -j4 --analyze tap_d set +x FINISH_SECS=$(date +"%s") ET=$(echo "scale=2;(${FINISH_SECS} - ${START_SECS})/60" | bc) date +"%n%F %T TIMEIT $ActionLabel finished. Elapsed time: ${ET} minutes."