Revisions
-
scsskid revised this gist
Sep 1, 2021 . No changes.There are no files selected for viewing
-
sutlxwhx revised this gist
Aug 24, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,7 +33,7 @@ For MySQL / MariaDB: ```shell cp -r /etc/mysql/ /backup/$now/mysql/ ``` ## Advanced Usage Everything above can be also used in a bash script for any package you want. Just create backup.sh with the following text: ```shell #!/usr/bin/env bash -
sutlxwhx revised this gist
Aug 24, 2018 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,7 @@ For MySQL / MariaDB: cp -r /etc/mysql/ /backup/$now/mysql/ ``` ## Advanced usage Everything above can be also used in a bash script for any package you want. Just create backup.sh with the following text: ```shell #!/usr/bin/env bash now=$(date +"%Y-%m-%d_%H-%M-%S") @@ -45,4 +45,12 @@ mkdir /backup/$now/mysql/ cp -r /etc/nginx/ /backup/$now/nginx/ cp -r /etc/php/ /backup/$now/php/ cp -r /etc/mysql/ /backup/$now/mysql/ ``` Make it executable: ```shell chmod +x backup.sh ``` And run from the current directory: ``` ./backup.sh ``` -
sutlxwhx revised this gist
Aug 24, 2018 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,17 @@ cp -r /etc/php/ /backup/$now/php/ For MySQL / MariaDB: ```shell cp -r /etc/mysql/ /backup/$now/mysql/ ``` ## Advanced usage Everything above can be also used in a bash script for any package you want: ```shell #!/usr/bin/env bash now=$(date +"%Y-%m-%d_%H-%M-%S") mkdir /backup/$now/nginx/ mkdir /backup/$now/php/ mkdir /backup/$now/php/ mkdir /backup/$now/mysql/ cp -r /etc/nginx/ /backup/$now/nginx/ cp -r /etc/php/ /backup/$now/php/ cp -r /etc/mysql/ /backup/$now/mysql/ ``` -
sutlxwhx revised this gist
Aug 24, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ This is the LAMP / LEMP environment backup guide in case you want or need to try ## 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") ``` -
sutlxwhx revised this gist
Aug 24, 2018 . No changes.There are no files selected for viewing
-
sutlxwhx renamed this gist
Aug 24, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
sutlxwhx created this gist
Aug 24, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ ## 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. <br/> 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/ ```