crontab does not work, but I do not see any trouble with this

Bug #694902 reported by Orgil Dashzeveg

This bug report was converted into a question: question #139310: crontab does not work, but I do not see any trouble with this.

10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

Hello.
I have inserted a few entries to the crontab using "sudo crontab -e" and vim editor. My crontab looks like below:
---------------------------------------------------------------
# m h dom mon dow command
5 11 * * * /home/gaali/db_backup.sh
~
~
~
--------------------------------------------------------------

db_backup.sh looks like below:
--------------------------------------------------------------
dest="$HOME"
day=$(date '+%y%m%d_%H%M')
name="gaali"
archive_file="$day.tar"

echo "Backing $name > $dest/$name$archive_file up ..."

pg_dump -U postgres -Ft -b $name > $dest/$name$archive_file

echo "... Backup finished"
-------------------------------------------------------------

When I run "sudo /home/gaali/db_backup.sh" then it works fine. But it requires postgreSQL password.

Does my shell command requiring password cause the crontab failure?

Please help me!!!
Any suggestion would be highly appreciated!

... Orgil

tags: added: backup cron crontab shell ubuntu
Changed in ubuntu:
status: New → Invalid
status: Invalid → New
Changed in ubuntu:
assignee: nobody → Orgil Dashzeveg (orgilhp)
Revision history for this message
Josh Kupershmidt (schmiddy) wrote :

Sounds like you're looking for the .pgpass file:
http://www.postgresql.org/docs/current/static/libpq-pgpass.html

If that doesn't work right away, a great place for help is the PostgreSQL mailing lists:
http://www.postgresql.org/community/lists/

Revision history for this message
Philip Muškovac (yofel) wrote :

This should be handled in the question.

Changed in ubuntu:
assignee: Orgil Dashzeveg (orgilhp) → nobody
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.