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=

Or download the batch file here: endbackup.cmd

Save it to the VPOP3 directory and run it from a command prompt (run “as an administrator”)

Keywords: stop kill terminate backup