[SEARCH PLUGIN IN WORPRESS PLUGIN OR BUY]
In the series of basic VPS and Centminmod & WordPress sure you all know through toolsWP-CLI which is used to manage / install WordPress on a UNIX environment is very powerful and easy to customize.
But did you know that, in addition to the command line of the WP-CLI available, it also has many other commands that if you install a plugin for WP-support CLI command, you can see more in plugin list WP-CLI support .
Of these, 3 plugins specializes Backup supports command line that BackUpWordPress ,BackWPUp and BackupBuddy . Do you have VPS and should use to backup resources is no longer a big problem anymore so in this article I will guide you to use WP-CLI plugin combined with BackWPUp simply because it's free but very powerful.
I. Use BackWPUp
First you need to install the plugin on sites and conducted BackWPUp Job creation for it.In Job creation is also very simple and I had more guidance here so will not say more over here.
After you create a Job, you need to be aware that each Job will have a unique ID as follows:
Or if you've installed WP-CLI then, then cd into the source directory and typing WordPress on a VPS
wp backwpup jobs
to view a list of the jobs are.
1
2
3
4
5
6
7
8
| cd / home / webdata / thachpham .dev / public_html wp backwpup jobs Warning: The `wp backwpup jobs` command has an invalid synopsis part: jobs List of jobs -------------------------------------------------- -------------------- ID: 1 Name: Test Job |
After running for a job done, you type the command:
1
| backwpup start --jobid wp = 1 |
In particular, the number
1
is the ID of the job should run. Results will be returned as follows:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| [INFO] BackWPup version 3.1.2; A project of Inpsyde GmbH [INFO] WordPress version 4.0 [INFO] Blog url: http: //thachpham.dev/ [INFO] BackWPup job: Job Test; FILE DBDUMP + + WPPLUGIN [INFO] Configured BackWPup no automatic start job [INFO] replied to form commandline interface BackWPup job [INFO] PHP ver .: 05/04/33; cli; Linux [INFO] Maximum PHP script execution time is 0 seconds [INFO] MySQL ver .: 05/05/39 [INFO] ver .: curl 7.19.7; NSS / 3.14.0.0 [INFO] Temp folder is: /home/webdata/thachpham.dev/public_html/wp-content/uploads/backwpup-4a3137-temp/ [INFO] logfile is: /home/webdata/thachpham.dev/public_html/wp-content/uploads/backwpup-4a3137-logs/backwpup_log_4a3137_2014-09-27_12-52-31.html [INFO] Backup type is: archive [INFO] Backup file is: /home/webdata/thachpham.dev/public_html/wp-content/uploads/backwpup-4a3137-backups/backwpup_4a3137_2014-09-27_12-52-31.tar.gz [27-Sep-2014 12:52:31] 1 Try to backup databases & # 160; ... [27-Sep-2014 12:52:31] Connected to database dulieu1 on <a href="http://thachpham.com/wordpress/tao-localhost-tren-may-tinh-toan-tap.html"><strong>localhost</strong></a> [27-Sep-2014 12:52:31] Backup database table "wp_automated_links" with "0" records [27-Sep-2014 12:52:31] Backup database table "wp_commentmeta" with "0" records [27-Sep-2014 12:52:31] Backup database table "wp_comments" with "1" records [27-Sep-2014 12:52:31] Backup database table "wp_links" with "0" records [27-Sep-2014 12:52:31] Backup database table "wp_options" with "1252" records [27-Sep-2014 12:52:31] Backup database table "wp_postmeta" with "4" records [27-Sep-2014 12:52:31] Backup database table "wp_posts" with "5" records [27-Sep-2014 12:52:31] Backup database table "wp_prli_clicks" with "0" records [27-Sep-2014 12:52:31] Backup database table "wp_prli_groups" with "0" records [27-Sep-2014 12:52:31] Backup database table "wp_prli_link_metas" with "0" records [27-Sep-2014 12:52:31] Backup database table "wp_prli_links" with "1" records [27-Sep-2014 12:52:31] Backup database table "wp_term_relationships" with "2" records [27-Sep-2014 12:52:31] Backup database table "wp_term_taxonomy" with "2" records [27-Sep-2014 12:52:31] Backup database table "wp_terms" with "2" records [27-Sep-2014 12:52:31] Backup database table "wp_usermeta" with "15" records [27-Sep-2014 12:52:31] Backup database table "wp_users" with "1" records [27-Sep-2014 12:52:31] Added database dump "dulieu1.sql" to backup files with 441.11 kB list [27-Sep-2014 12:52:31] Database backup done! [27-Sep-2014 12:52:31] 1 Trying to make a list of folders to back up & # 160; ... [27-Sep-2014 12:52:31] 453 folders to backup. [27-Sep-2014 12:52:31] 1 Trying to generate a file with names plugin installed & # 160; ... [27-Sep-2014 12:52:31] Added plugin file list "Hoc-VPS.pluginlist.2014-09-27.txt" KB with 1:00 to backup file list. [27-Sep-2014 12:52:31] 1 Trying to generate a manifest file & # 160; ... [27-Sep-2014 12:52:31] Added manifest.json with 4:24 kB file to backup file list. [27-Sep-2014 12:52:31] Trying to create backup archive 1 ... [27-Sep-2014 12:52:31] Compressing files as TarGz. Please be patient, this may take a moment. [27-Sep-2014 12:52:37] created backup archive. [27-Sep-2014 12:52:37] Archive is 14:10 MB size. [27-Sep-2014 12:52:37] 3614 Files with 41.86 MB in Archive. [27-Sep-2014 12:52:37] Job done in 6 seconds. |
And now you go to the WordPress Admin -> BackWPUp -> Backups will see the backup files are displayed in the following.
Well, needless to say, if you set the Destination Job to send files through 3rd party services when running this command will send the file it away for you too. Of course you can not use these methods to send files to sites like Dropbox, Amazon S3, Rackspace if you use localhost or a virtual domain set in the hosts file, because it will be checked before receiving the data domain.
Some other commands BackWPUp
In addition to the start command to execute the Job, it also has some other commands which you can see by typing wp backwpup. I would like to explain some of the command line as follows:
wp backwpup abort
- abort jobs is workingwp backwpup jobs
- View a list of jobswp backwpup start
-jobid = <JOBID> - Execute a certain job, I said at the topwp backwpup working
- View a list of jobs that are running
III. WP backup database command in CLI
WP CLI commands supported
wp db export
to backup the database you are using a file .sql. So if you just need to backup the database then cd multitude of websites to backup folder and run this command is finished.
1
2
| [Root @ hocvps public_html] # wp db export Success: Exported to dulieu1.sql |
0 nhận xét:
Post a Comment