sábado, 8 de agosto de 2020

iDempiere Database Automatic Backup in Windows

Create a new batch file in windows call it "GenerateiDempiereBackup.bat" and then copy the folling instructions:


@echo off

for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set DateTime=%%a

set Yr=%DateTime:~0,4%
set Mon=%DateTime:~4,2%
set Day=%DateTime:~6,2%
set Hr=%DateTime:~8,2%
set Min=%DateTime:~10,2%
set Sec=%DateTime:~12,2%

set DatabaseName=BLC

set BackupName=%DatabaseName%%Day%%Mon%%Yr%_%Hr%%Min%%Sec%.backup

SET PGPASSWORD=adempiere
echo on
pg_dump -h localhost -d BLC -U adempiere -p 5432 -F c -b -v > "C:\Backups\"%BackupName%


You can try execute this batch file using cmd as you can see the follow image:

Now, we have to do it as schedule task using the next link:


https://www.genbeta.com/paso-a-paso/como-programar-tareas-en-windows-10



No hay comentarios:

Publicar un comentario