Posts

Showing posts from February, 2007

[FreeBSD] How to change from sh to bash as default shell

1. Installing bash $ sudo pkg install bash Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: bash: 4.4.12_3 Number of packages to be installed: 1 The process will require 8 MiB more space. 1 MiB to be downloaded. Proceed with this action? [y/N]: $ sudo pkg install bash Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: bash: 4.4.12_3 Number of packages to be installed: 1 The process will require 8 MiB more space. 1 MiB to be downloaded. Proceed with this action? [y/N]: y [1/1] Fetching bash-4.4.12_3.txz: 100% 1 MiB 1.5MB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing bash-4.4.12_3... Extracting bash-4.4.12_3: 100% 2. List of acceptable shel...

PostgreSQL: Backup and Restore(large databases)

For very large databases, you might need to combine split with one of the other two approaches. 1. nohup pg_dump -h 192.168.x.x -d dbname -U username -Fc > filename.dmp 2>&1 & -F format (--c custom) A custom-format dump is not a script for psql, but instead must be restored with pg_restore, for example: $ dropdb mydb $ pg_restore -C -d postgres db.dump $ createdb -T template0 newdb $ pg_restore -d newdb db.dump 2. nohup pg_restore -C -d newdb filename.dmp 2>&1 & -C --create Create the database before restoring into it. -d dbname --dbname=dbname -O --no-owner Do not output commands to set ownership of objects to match the original database. By default, pg_restore issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail unless the initial connection to the database is made by a superuser (or the same user that owns all of the objects in the script). With -O, any user n...