User Tools

Site Tools


reference:batch_file_to_end_a_database_backup

This is an old revision of the document!


Batch file to end a database backup

VPOP3 runs pg_dump.exe to perform the regular database backups. Ending this process through Task Manager will not end the back-end database processes creating the backup data. This batch file will do it for you.

Save this in the VPOP3 installation directory as a file such as 'endbackup.cmd'

@ECHO OFF
SETLOCAL
CALL psqlparams.cmd
SET PGPASSWORD=pgsqlpass
taskkill /f /im:pg_dump.exe
"%PSQLPATH%\psql" -U postgres -c "select pg_cancel_backend((select procpid from pg_stat_activity where application_name='pg_dump'));" vpop3
SET PGPASSWORD=

Keywords: stop kill terminate backup

reference/batch_file_to_end_a_database_backup.1470904721.txt.gz · Last modified: 2018/11/14 10:44 (external edit)