Thread: >>>>> pg_dump in crontab
Hi, I need to back up my database "test" at 23:30 everyday. $ crontab -l 30 23 * * * pg_dump test > test.out I got an error massage /bin/sh: pg_dump: command not found $ which pg_dump /usr/local/pgsql/bin/pg_dump $ crontab�@-l 30 23 * * * /usr/local/pgsql/bin/pg_dump test > /home/iwan/test.out I got another error message /usr/local/pgsql/bin/pgdump: error in loading shared libraries: libpq.so.2.0: cannot open shared object file: No such file or directory But in my machine libpq.so.2.0 located in /usr/local/src/postgresql-6.5.2/src/interface/libpq/libpq.so.2.0 /usr/local/pgsql/lib/libpq.so.2.0 What's wrong? Please help me ... Thanks in advance Iwan __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf ldconfig -v [note >> means APPEND] That should fix it -- Mike "Iwan Tutuka Pambudi" <itpambudi@yahoo.com> wrote in message news:20010117033047.8997.qmail@web219.mail.yahoo.com... > > Hi, > > I need to back up my database "test" at 23:30 > everyday. > > $ crontab -l > 30 23 * * * pg_dump test > test.out > > I got an error massage > /bin/sh: pg_dump: command not found > > $ which pg_dump > /usr/local/pgsql/bin/pg_dump > $ crontab�@-l > 30 23 * * * /usr/local/pgsql/bin/pg_dump test > > /home/iwan/test.out > > I got another error message > /usr/local/pgsql/bin/pgdump: error in loading shared > libraries: libpq.so.2.0: cannot open shared object > file: No such file or directory > > But in my machine libpq.so.2.0 located in > /usr/local/src/postgresql-6.5.2/src/interface/libpq/libpq.so.2.0 > /usr/local/pgsql/lib/libpq.so.2.0 > > What's wrong? Please help me ... > > > Thanks in advance > Iwan > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/
thats assuming linux (gotta mention that) -- Mike "Mike Miller" <temp6453@hotmail.com> wrote in message news:9434st$kp0$1@news.tht.net... > echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf > ldconfig -v > > [note >> means APPEND] > > That should fix it > -- > Mike > > > "Iwan Tutuka Pambudi" <itpambudi@yahoo.com> wrote in message > news:20010117033047.8997.qmail@web219.mail.yahoo.com... > > > > Hi, > > > > I need to back up my database "test" at 23:30 > > everyday. > > > > $ crontab -l > > 30 23 * * * pg_dump test > test.out > > > > I got an error massage > > /bin/sh: pg_dump: command not found > > > > $ which pg_dump > > /usr/local/pgsql/bin/pg_dump > > $ crontab�@-l > > 30 23 * * * /usr/local/pgsql/bin/pg_dump test > > > /home/iwan/test.out > > > > I got another error message > > /usr/local/pgsql/bin/pgdump: error in loading shared > > libraries: libpq.so.2.0: cannot open shared object > > file: No such file or directory > > > > But in my machine libpq.so.2.0 located in > > /usr/local/src/postgresql-6.5.2/src/interface/libpq/libpq.so.2.0 > > /usr/local/pgsql/lib/libpq.so.2.0 > > > > What's wrong? Please help me ... > > > > > > Thanks in advance > > Iwan > > > > __________________________________________________ > > Do You Yahoo!? > > Get email at your own domain with Yahoo! Mail. > > http://personal.mail.yahoo.com/ > >
Hi Mike, That's right .... thanks. Another problem :-( In my computer "pg_dump"; "psql" and "destroydb" are located in /usr/ local/pgsql/bin $ crontab -l 35 23 * * * /usr/local/pgsl/bin/destroydb test An error message occured /usr/local/pgsql/bin/destroydb: psql: command not found destroydb: database destroy failed on test. Could you fix it? T.I.A. Iwan --- Mike Miller <temp6453@hotmail.com> wrote: > echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf > ldconfig -v > > [note >> means APPEND] > > That should fix it > -- > Mike > > > "Iwan Tutuka Pambudi" <itpambudi@yahoo.com> wrote�F > > $ which pg_dump > > /usr/local/pgsql/bin/pg_dump > > $ crontab�@-l > > 30 23 * * * /usr/local/pgsql/bin/pg_dump test > > > /home/iwan/test.out > > > > I got another error message > > /usr/local/pgsql/bin/pgdump: error in loading > shared > > libraries: libpq.so.2.0: cannot open shared object > > file: No such file or directory > > > > But in my machine libpq.so.2.0 located in > > > /usr/local/src/postgresql-6.5.2/src/interface/libpq/libpq.so.2.0 > > /usr/local/pgsql/lib/libpq.so.2.0 __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Iwan Tutuka Pambudi wrote: >$ crontab -l >30 23 * * * pg_dump test > test.out > >I got an error massage >/bin/sh: pg_dump: command not found > >$ which pg_dump >/usr/local/pgsql/bin/pg_dump cron has a very limited search list for executables; you should set PATH in the command or use the full pathname for pg_dump: 30 23 * * * /usr/local/pgsql/bin/pg_dump test > test.out or 30 23 * * * PATH=/usr/local/pgsql/bin:$PATH pg_dump test > test.out -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "And, behold, I come quickly; and my reward is with me, to give every man according as his work shall be." Revelation 22:12
Or do what I do 30 23 * * * ~/.bashrc ; /usr/local/pgsql/bin/pg_dump test > test.out assuming you use bash, of course. Oliver Elphick wrote: > > Iwan Tutuka Pambudi wrote: > >$ crontab -l > >30 23 * * * pg_dump test > test.out > > > >I got an error massage > >/bin/sh: pg_dump: command not found > > > >$ which pg_dump > >/usr/local/pgsql/bin/pg_dump > > cron has a very limited search list for executables; you should set PATH > in the command or use the full pathname for pg_dump: > > 30 23 * * * /usr/local/pgsql/bin/pg_dump test > test.out > > or > > 30 23 * * * PATH=/usr/local/pgsql/bin:$PATH pg_dump test > test.out > > -- > Oliver Elphick Oliver.Elphick@lfix.co.uk > Isle of Wight http://www.lfix.co.uk/oliver > PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 > GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C > ======================================== > "And, behold, I come quickly; and my reward is with me, > to give every man according as his work shall be." > Revelation 22:12 -- Joseph Shraibman jks@selectacast.net Increase signal to noise ratio. http://www.targabot.com