eve-doc/home.markdown

2.2 KiB

Database

postgres

  • Host: postgres
$ create-postgres-user-and-database foo bar # create user `foo` and give him access to database `bar`

Administration shell:

$ sudo psql -h postgres -U postgres
psql> \l                    # list databases
psql> \c <database>         # connect to database
psql> \d                    # show tables
$ sudo pg_dump -h postgres -U postgres <dbname> > dump.sql # backup
$ sudo psql -h postgres -U postgres < dump.sql             # restore

mysql

  • Host: mysql
$ create-mysql-user-and-database foo # create database and user `foo`

List zfs snapshots

$ cd /data/containers/<name>/rootfs/.zfs # .zfs directory is hidden and will not be shown by `ls -a`
$ ls

Backups

  • located in /backup/rsync
  • mysql dumps: /backup/rsync/mysqldbs
  • postgres dumps: /backup/rsync/postgresdbs
  • zfs snapshosts: /backup/rsync/.zfs/snapshot
  • default backup location for containers: home, srv, etc, usr/local
  • systemd service files: backup-daily.{timer,service}, backup-weekly.{timer,service}

Ldap

Administration: https://ldap.higgsboson.tk

objectclass description
mailaccount access imap/smtp
owncloud https://cloud.higgsboson.tk
gitlab https://git.higgsboson.tk
ttrss https://rss.higgsboson.tk
jabber xmpp

Mail

Key Value
Imap imap.higgsboson.tk, Port 143
Smtp smtp.higgsboson.tk, Port 567
Sieve imap.higgsboson.tk, Port 4190
Webmail https://mail.higgsboson.tk
Encryption STARTTLS or TLS
MX-Record mail.higgsboson.tk
SRV-Record v=spf1 a:mail.higgsboson.tk ip6:2a01:4f8:210:31fd:1::10 -all

LXC

$ lxc-attach -n <name>        # login
$ systemctl start lxc@<name>  # start container
$ systemctl stop lxc@<name>   # stop container

Get logs

lxc-log <CONTAINER> <SERVICE>

example:

$ lxc-log mail postfix # get logs of postfix service in the mail container
$ lxc-log mail postfix -f # Additional parameter are passed to journalctl