Skip to content

Instantly share code, notes, and snippets.

@rothkj1022
Last active May 20, 2019 15:51
Show Gist options
  • Save rothkj1022/f46cdf68ca9fa0b04364cc4326ca1486 to your computer and use it in GitHub Desktop.
Save rothkj1022/f46cdf68ca9fa0b04364cc4326ca1486 to your computer and use it in GitHub Desktop.
CWP Config Files Backup Instructions

CWP Config Files Backup

Last Updated 2019-02-22 by Kevin Roth

Set up hard links and mounted folders in order to make remote backups of the system configuration.

Make directories

$ mkdir /backup/config
$ mkdir /backup/config/etc
$ mkdir /backup/config/etc/my.cnf.d
$ mkdir /backup/config/etc/postfix
$ mkdir /backup/config/opt
$ mkdir /backup/config/opt/alt
$ mkdir /backup/config/usr
$ mkdir /backup/config/usr/local
$ mkdir /backup/config/usr/local/apache
$ mkdir /backup/config/usr/local/php

Hard link files:

$ cd /backup/config
$ ln /etc/fstab
$ ln /etc/my.cnf
$ ln /etc/postfix/main.cf

Mount folders

Symlinked folders will not sync to Amazon S3, so we mount them using fstab.

Set up fstab to auto mount folders on boot:

$ nano /etc/fstab
Paste the following at the end of the file:
# Mount file paths for backing up config
/etc/my.cnf.d   /backup/config/etc/my.cnf.d     none    ro,defaults,bind        0 0
/opt/alt /backup/config/opt/alt none	ro,defaults,bind        0 0
/usr/local/apache /backup/config/usr/local/apache       none    ro,defaults,bind        0 0
/usr/local/php /backup/config/usr/local/php     none    ro,defaults,bind        0 0
Test fstab mappings:
$ mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment