Assume that postgresql is installed in /usr/local/pgsql directory.
$crontab -e
22 3 * * * su - postgres -c "/usr/local/pgsql/bin/vacuumdb -a -f" >> /var/log/vacuumdb.log 2>&1
23 3 * * * su - postgres -c "/usr/local/pgsql/bin/pg_dump -Fc -b -f /tmp/db.sql db" > /var/log/dump.log 2>&1
and then save like under vi editor.
$crontab -l
to list the task
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment