## Introduction This is the LAMP / LEMP environment backup guide in case you want or need to try my [highload LEMP installation](https://github.com/sutlxwhx/highload-lemp-installation). ## Basic usage As a first thing we will setup a variable that will store current date and time. We will use year-month-day_hours-minutes-seconds format: ```shell now=$(date +"%Y-%m-%d_%H-%M-%S") ``` Then we need to create a folder where Nginx configuration files will be stored: ```shell mkdir /backup/$now/nginx/ ``` We will repeat previous step for your PHP installation: ```shell mkdir /backup/$now/php/ ``` If you already have MySQL or MariaDB installed do this step too: ```shell mkdir /backup/$now/mysql/ ``` This is the main backup process, just copy files from one folder to another.
For Nginx: ```shell cp -r /etc/nginx/ /backup/$now/nginx/ ``` For PHP: ```shell cp -r /etc/php/ /backup/$now/php/ ``` For MySQL / MariaDB: ```shell cp -r /etc/mysql/ /backup/$now/mysql/ ```