Pages

Ubuntu 22.04 Snap store update error

Recently i had a problem while updating Ubuntu via Ubuntu Software app.

The problem was that it cannot update it because the snap-store is running.

After some searching the solution was simple:


sudo kill snap

sudo snap refresh


After that everything is back to normal :)

PostgreSQL backup script Windows Server 2019

A few days ago I had to create a backup script for my PostgreSQL server running on Windows.

After few minutes the script looks like this:


@echo off

SET DBHOST=localhost
set DBNAME=YOUR_DB_NAME
set DBUSER=YOUR_DB_USERNAME
set PGPASSWORD=YOUR_DB_PASSWORD
:: Path to PostgreSQL pg_dump.exe
set PGDUMP="C:\Program Files\PostgreSQL\14\bin\pg_dump.exe" 
:: Get date in YYYY-MM-DD format
set CURRENTDATE=%date:~6,4%%date:~3,2%%date:~0,2%
set BACKUPDIR=BACKUP_DIRECTORY

%PGDUMP% --host %DBHOST% --port 5432 --format custom --blobs --username %DBUSER% -f "%BACKUPDIR%\%CURRENTDATE%-%DBNAME%.backup" %DBNAME%
 
And it is working now like a charm :)