Posts

Showing posts with the label pg_backup_rotated

Mount StorageBox to the server for backup

  Quickly  solution Install cifs-utils: apt-get install cifs-utils Adjust and add the following lines to   crontab -e   : # reboot # This one should be moved to /etc/fstab @reboot /sbin/mount.cifs -o user=uXXXXXXXX,pass=xxxxxXXXXXX//uXXXXXX.your-storagebox.be/backup /mnt/storagebox_jobsites_backup/ SAMBA/CIFS You can mount your Storage Box via Samba/CIFS. You can use the following UNC path. If you are using your main account, the share name is  backup . If you are using a sub-account, you must use the username of the sub-account as the username and share name. Linux/Unix: //<username>.your-storagebox.de/<share_name> Windows \\<username>.your-storagebox.de\<share_name> If you use a FritzBox Router from AVM, you need to deactivate the NetBIOS filter for Samba/CIFS to work. Please check the AVM knowledge base for more information.  https://en.avm.de/service/knowledge-base/dok/FRITZ-Box-7590/835_Shared-files-and-printers-o...

Automate PostgreSql Backup with Cron

  Create The  Postgres Password File The file  .pgpass  in a user’s home directory can contain passwords to be used if the connection requires a password (and no password has been specified otherwise). On Microsoft Windows the file is named  %APPDATA%\postgresql\pgpass.conf  (where  %APPDATA%  refers to the Application Data subdirectory in the user’s profile). Alternatively, the password file to use can be specified using the connection parameter passfile or the environment variable  PGPASSFILE . Let’s see if the  postgres user  already has a password: sudo -u postgres psql select * from pg_authid; If  rolpassword  is empty, set the password: ALTER USER postgres PASSWORD 'mypassword'; \q Create  .pgpass vim ~/.pgpass # Add the following line # hostname:port:database:username:password localhost:*:*:postgres:[password] Add Environment variable  PGPASSFILE export PGPASSFILE= '/root/.pgpass' vim /etc/environment ...