File tree Expand file tree Collapse file tree 5 files changed +47
-13
lines changed
Expand file tree Collapse file tree 5 files changed +47
-13
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,8 @@ The goal of this project is to create a quick virtual machine setup with a WordP
3232
3333## Backup and Restores
34341 . In order to do backup and restores login to your virtual machine - ` $ vagrant ssh `
35- 2 . ` $ cd /quick-wordpress `
36- 3 . ` $ ./backup.sh ` and follow the on screen instructions
37- 4 . Backups are saved in the ` /quick-wordpress/backups ` directory
38- 5 . If you'd like to restore from a previous backup - ` $ ./restore.sh ` and follow the on screen instructions
35+ 2 . ` $ qwcli backup ` and follow the on screen instructions
36+ 3 . If you'd like to restore from a previous backup - ` $ qwcli restore ` and follow the on screen instructions
3937
4038## Cleanup
41391 . If you are ready to delete your WordPress VM from you local machine - ` $ vagrant destroy -f `
42-
43- ## Project Roadmap
44- * ~~ LAMP Stack installed on Virtual Machine with WordPress using Vagrant~~
45- * ~~ Plugin installations on initial WordPress install~~
46- * ~~ Site Backups~~
47- * ~~ Site Restores~~
48- * Web Application instead of bash scripts for WordPress install, backup, and restore
49- * Modifications to WP details in order to give a working WordPress backup to a host
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ sudo -E mysql -u root -p$mysql_root_password -e "create database $wp_db;"
4141sudo -E mysql -u root -p$mysql_root_password -e " GRANT ALL PRIVILEGES ON $wp_db .* TO $wp_db_user @localhost IDENTIFIED BY '$wp_db_password '"
4242sudo -E mysql -u root -p$mysql_root_password -e " GRANT ALL PRIVILEGES ON $wp_db .* TO phpmyadmin@localhost IDENTIFIED BY '$phpyadmin_password '"
4343
44+ echo " ***************************** Install QWCli *****************************"
45+ sudo -E ln -s /quick-wordpress/qwcli/qwcli.sh /usr/local/bin/qwcli
46+
4447echo " ***************************** Install WPCli *****************************"
4548cd /home/$USER
4649curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # https://github.com/brotandgames/bagcli -- example location
4+
5+ cli_help () {
6+ cli_name=${0##*/ }
7+ echo "
8+ $cli_name
9+ Quick WordPress CLI
10+ Version: 1.0.0
11+ https://github.com/russellmacshane/quick-wordpress
12+
13+ Usage: $cli_name [command]
14+
15+ Commands:
16+ backup Backup
17+ list List Backups
18+ restore Restore
19+ * Help
20+ "
21+ exit 1
22+ }
23+
24+ case " $1 " in
25+ backup|b)
26+ /quick-wordpress/qwcli/backup.sh
27+ ;;
28+ list|l)
29+ ls /quick-wordpress/backup
30+ ;;
31+ restore|r)
32+ /quick-wordpress/qwcli/restore.sh
33+ ;;
34+ * )
35+ cli_help
36+ ;;
37+ esac
Original file line number Diff line number Diff line change @@ -5,10 +5,14 @@ source /quick-wordpress/config
55echo " ***************************** WordPress Restore **************************"
66read -p " Enter the filename of the backup you would like to restore: " file
77
8- backup_file=/quick-wordpress/backup/$file
8+ backup_dir=/quick-wordpress/backup
9+ backup_file=$backup_dir /$file
910
1011if [ ! -f $backup_file ]; then
1112 echo " $backup_file not found!" 1>&2
13+ echo " "
14+ echo " Available backups in $backup_dir "
15+ ls $backup_dir
1216 exit 1
1317fi
1418
You can’t perform that action at this time.
0 commit comments