You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2) It is also necessary to adjust the psql command:
+ case $baculaDbSgdb in + sql='env PGPASSWORD=password /usr/bin/psql -hserver -p5432 -Ubacula -dbacula -c' ++ env 'PGPASSWORD=password' /usr/bin/psql -hserver -p5432 -Ubacula -dbacula -c 'select Type from Job where JobId=325;' + baculaJobType=' type ------ B (1 registro)' + '[' ' type ------ B (1 registro)' '!=' B ']' + exit 9
Hi,
1) The line below does not work in bash:
P) sql="PGPASSWORD=$baculaDbPass /usr/bin/psql -h$baculaDbAddr -p$baculaDbPort -U$baculaDbUser -d$baculaDbName -c" ;;
Error output:
++ 'PGPASSWORD=password' /usr/bin/psql -hserver -p5432 -Ubacula -dbacula -c 'select Type from Job where JobId=325;'
/var/spool/bacula/bacula-zabbix.bash: linha 22: PGPASSWORD=password: comando não encontrado
+ baculaJobType=
+ '[' '' '!=' B ']'
+ exit 9
Correction:
P) sql="env PGPASSWORD=$baculaDbPass /usr/bin/psql -h$baculaDbAddr -p$baculaDbPort -U$baculaDbUser -d$baculaDbName -c" ;;
2) It is also necessary to adjust the psql command:
+ case $baculaDbSgdb in
+ sql='env PGPASSWORD=password /usr/bin/psql -hserver -p5432 -Ubacula -dbacula -c'
++ env 'PGPASSWORD=password' /usr/bin/psql -hserver -p5432 -Ubacula -dbacula -c 'select Type from Job where JobId=325;'
+ baculaJobType=' type
------
B
(1 registro)'
+ '[' ' type
------
B
(1 registro)' '!=' B ']'
+ exit 9
Correction:
P) sql="env PGPASSWORD=$baculaDbPass /usr/bin/psql -h$baculaDbAddr -p$baculaDbPort -U$baculaDbUser -d$baculaDbName -t -A -c" ;;
-A
--no-align
Switches to unaligned output mode. (The default output mode is otherwise aligned.)
-t
--tuples-only
Turn off printing of column names and result row count footers, etc. This is equivalent to the \t command.
The text was updated successfully, but these errors were encountered: