Linux update HOWTO

Backup

  • Backup /etc:
    • tar cvzf /home/export/backup/etc_yyyymmdd.tgz /etc
    • drakbackup
      • /etc/drakxtools/drakbackup/
  • Backup mysql databases: /var/lib/mysql
    • tar cvzf /home/export/backup/mysql_yyyymmdd.tgz /var/lib/mysql
    • mysqldump
      • mysqldump -u root -p --all-databases > mysql_yyyymmdd.sql
      • mysqldump -u root -p --all-databases --xml > mysql_yyyymmdd.xml
    • mysql-administrator
      • tar cvzf /home/export/backup/mysqlgui_yyyymmdd.tgz /root/.mysqlgui
      • backup profiles: /root/.mysqlgui/backup_profiles
        • backup_timetracker
        • backup_bugzilla
        • backup_wiki
      • Tools / Preferences 
        • General Options: Store connection passwords (Obscured) (solves "Backup error: Cannot set ANSI quotes")
        • Connections: write password
      • connections: /root/.mysqlgui/mysqlx_user_connections.xml
    • mysql-workbench
      • ...
  • Backup http server: /var/www
    • tar cvzf /home/export/backup/www_yyyymmdd.tgz /var/www
  • Samba
  • bugzilla
    • /var/lib/bugzilla
    • backup
  • VDR
    • /var/lib/vdr
  • MythTV
  • cron
    • tar cvzf /home/export/backup/cron_yyyymmdd.tgz /var/spool/cron

Installation

  • network
    • IP address
    • computer name
      • /etc/sysconfig/network
        • HOSTNAME=pctoto
  • NTP

System

  • Configure /etc/hosts
    • 127.0.0.1 pctoto localhost
  • Restore /etc
    • tar -C /tmp -xvzf /home/export/backup/etc_yyyymmdd.tgz
    • Restore users (*)
      • cp /tmp/etc/passwd /etc/passwd
      • cp /tmp/etc/shadow /etc/shadow
    • Restore groups
      • cp /tmp/etc/group /etc/group
    • Restore drakbackup profiles
      • cp -pr /tmp/etc/drakxtools/drakbackup/ /etc/drakxtools/
    • Restore credentials for fstab
      • cp /tmp/etc/samba/auth* /etc/samba
    • Restore /etc/fstab
  • Configure Firewall
    • allow
      • SSH
      • Web server
      • SMB
      • ping
      • (cvs server): 2401/tcp
      • (svn server)
      • (nfs)
      • wiki:
        • Collection extension: 8899/tcp
  • Configure security (mcc)
    • security level: high
    • Adjust system permissions
      • Add new rule
        • /home/export -> 755
  • Configure Samba
    • /etc/samba/smb.conf
      • workgroup=DTM
    • check
      • testparm
      • smbclient -L localhost -U%
  • Configure Apache
    • /etc/httpd/conf/httpd.conf
      • Listen 172.16.11.5:80
      • ServerName pctoto
  • Restore MySQL
    • mysql -u root -p < mysql_yyyymmdd.sql
    • tar -C / -xvzf /home/export/backup/mysql_backup_yyyymmdd.tgz
    • Tools / Preferences 
      • General Options: Store connection passwords (Obscured) (solves "Backup error: Cannot set ANSI quotes")
      • Connections: write password
      • Introduce password for the used connection
  • Configure cron
    • export EDITOR=emacs; crontab -e
    • /var/spool/cron
      • 0 23 * * * /root/backup_base_dades.sh
        0 22 1 * * export USER=usuari; /usr/sbin/drakbackup --profile servidor_cvs_full.conf --daemon > /dev/null 2>&1
        0 22 * * 6 export USER=usuari; /usr/sbin/drakbackup --profile servidor_cvs_differential.conf --daemon > /dev/null 2>&1
        0 22 * * * export USER=usuari; /usr/sbin/drakbackup --profile servidor_cvs_incremental.conf --daemon > /dev/null 2>&1
        0 23 1 * * export USER=usuari; /usr/sbin/drakbackup --profile servidor_export_cvs_full.conf --daemon > /dev/null 2>&1
        0 23 * * 6 export USER=usuari; /usr/sbin/drakbackup --profile servidor_export_cvs_differential.conf --daemon > /dev/null 2>&1
        0 23 * * * export USER=usuari; /usr/sbin/drakbackup --profile servidor_export_cvs_incremental.conf --daemon > /dev/null 2>&1
        0 04 * * * /bin/find /var/export/backup/ -mtime -1 -type f -exec cp -pf '{}' /mnt/external_dir/copia_seguretat \; > /dev/null 2>&1
    • /root/backup_base_dades.sh
      • #!/bin/bash
        export DB_BACKUP_DIR="/var/export/backup"
        export DB_USER="root"
        export DB_PASSWD="******"
        export DATE="`date '+%Y%m%d_%H%M'`"
        mysqldump -u$DB_USER -p$DB_PASSWD timetracker > $DB_BACKUP_DIR/backup_timetracker_$DATE.sql
        mysqldump -u$DB_USER -p$DB_PASSWD wikidb > $DB_BACKUP_DIR/backup_wikidb_$DATE.sql


  • Configure Mediawiki
    • Moving a wiki
    • using mysql-administrator, retype passwords for user:
      • wikiuser
    • restore config files:
      • cp /tmp/var/www/mediawiki/LocalSettings.php /var/www/mediawiki/LocalSettings.php
      • cp /tmp/var/www/mediawiki/AdminSettings.php
      • cp -pr /tmp/var/www/mediawiki/extensions/ /var/www/mediawiki/
      • cp -pr /tmp/var/www/mediawiki/images/ /var/www/mediawiki/
      • cp -pr /tmp/var/www/mediawiki/papers/ /var/www/mediawiki/
  • Configure WRTimetracker

Services


urpmi /etc /var other firewall service restart
OpenSSH openssh-server


SSH sshd
CVS cvs
xinetd
cvs/cvs.conf

2401/tcp xinetd
Samba samba-server samba/smbpasswd
samba/smb.conf


SMB smb
MySQL mysql my.cnf lib/mysql

mysqld
mysql-administrator mysql-administrator

/root/.mysqlgui/backup_profiles
/root/.mysqlgui/mysqlx_user_connections.xml


Bugzilla bugzilla bugzilla/localconfig lib/bugzilla
Web server
cron

spool/cron


drakbackup
drakxtools/drakbackup/
  • servidor_*_full.conf
  • servidor_*_differential.conf
  • servidor_*_incremental.conf
lib/drakbackup


http://www.francescpinyol.cat/linux_update.html
Primera versió: / First version: 20.III.2008
Darrera modificació: 13 de setembre de 2011 / Last update: 13th September 2011

Valid HTML 4.01!

Cap a casa / Back home.