mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
commit
4fb3bfd704
@ -1,4 +1,4 @@
|
||||
如何在Crunchbang下回复Openbox的默认配置
|
||||
如何在Crunchbang下恢复Openbox的默认配置
|
||||
================================================================================
|
||||
[CrunchBang][1]是一个很好地融合了速度、风格和内容的基于Debian GNU/Linux的发行版。使用了灵活的Openbox窗口管理器,高度定制化并且提供了一个现代、全功能的GNU/Linux系统而没有牺牲性能。
|
||||
|
||||
@ -6,7 +6,7 @@ Crunchbang是高度自定义的,用户可以尽情地地把它调整成他们
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/09/curnchbang_menu_xml.png)
|
||||
|
||||
其中从菜单配置文件中去除了所有代码。由于我没有备份(最好备份配置文件)。我不得不搜索Crunchbang开箱即用的默认配置。这里就是我如何修复的过程,要感谢Crunchbang论坛。
|
||||
我的菜单配置文件中丢失了所有内容。由于我没有备份(最好备份配置文件)。我不得不搜索Crunchbang安装后的默认配置。这里就是我如何修复的过程,这里要感谢Crunchbang论坛。
|
||||
|
||||
了解所有为你预备份的默认配置是很有趣的,你可以在这里找到:
|
||||
|
||||
@ -30,7 +30,7 @@ via: http://www.unixmen.com/recover-default-openbox-config-files-crunchbang/
|
||||
|
||||
作者:[Enock Seth Nyamador][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,4 +1,4 @@
|
||||
数据库常见问题答案--如何使用命令行创建一个MySQL数据库
|
||||
Linux有问必答:如何在命令行创建一个MySQL数据库
|
||||
===
|
||||
|
||||
> **问题**:在一个某处运行的MySQL服务器上,我该怎样通过命令行创建和安装一个MySQL数据库呢?
|
||||
@ -47,8 +47,8 @@
|
||||
为了达到演示的目的,我们将会创建一个叫做posts_tbl的表,表里会存储关于文章的如下信息:
|
||||
|
||||
- 文章的标题
|
||||
- 作者的第一个名字
|
||||
- 作者的最后一个名字
|
||||
- 作者的名字
|
||||
- 作者的姓
|
||||
- 文章可用或者不可用
|
||||
- 文章创建的日期
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
via: http://ask.xmodulo.com/create-mysql-database-command-line.html
|
||||
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linu
|
||||
x中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,41 @@
|
||||
Adobe从网站上撤下了Linux PDF Reader的下载链接
|
||||
================================================================================
|
||||
<center>![Linux上的其他PDF解决方案](http://www.omgubuntu.co.uk/wp-content/uploads/2012/07/test-pdf.jpg)</center>
|
||||
|
||||
|
||||
**由于该公司从网站上撤下了软件的下载链接,因此这对于任何需要在Linux上使用Adobe这家公司的PDF阅读器的人而言有些麻烦了。**
|
||||
|
||||
[Reddit 上的一个用户][1]发帖说,当他去 Adobe 网站上去下载该软件时,Linux并没有列在[支持的操作系统][2]里。
|
||||
|
||||
不知道什么时候,更不知道为什么,Linux版本被删除了,不过第一次被发现是在八月份。
|
||||
|
||||
这也并没有让人太惊讶。Adobe Reader 官方的Linux版本在2013年5月才更新,而且当时还在滞后的版本9.5.x上,而Windows和Mac版已经在v11.x。
|
||||
|
||||
### 谁在意呢?无所谓 ###
|
||||
|
||||
这是一个巨大的损失么?你可能并不会这么想。毕竟Adobe Reader是一款名声不好的app。速度慢,占用资源而且体积臃肿。而原生的PDF阅读app像Evince和Okular提供了一流的体验而没有上面的那些缺点。
|
||||
|
||||
除开Snark,这一决定将会影响一些事。一些政府网站只能使用官方Abode应用才能完成或者提交提供的官方文档和程序。
|
||||
|
||||
Adobe把Linux给刷了这事并不鲜见。该公司在2012年[停止了Linux上flash版本的更新][3](把它留给Google去做),[并且此前从它们的跨平台运行时环境“Air”中排除了踢开了Linux用户][4]。
|
||||
|
||||
不过并没有失去一切。虽然网在不再提供链接了,然而在Adobe FTP服务器上仍有Debian的安装程序。计划使用老的版本?需要自己承担风险且没有来自Adobe的支持。同样注意这些版本可能还有没有修复的漏洞。
|
||||
|
||||
- [下载Ubuntu版本的 Adobe Reader 9.5.5][5]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/10/adobe-reader-linux-download-pulled-website
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://www.reddit.com/r/linux/comments/2hsgq6/linux_version_of_adobe_reader_no_longer/
|
||||
[2]:http://get.adobe.com/reader/otherversions/
|
||||
[3]:http://www.omgubuntu.co.uk/2012/02/adobe-adandons-flash-on-linux
|
||||
[4]:http://www.omgubuntu.co.uk/2011/06/adobe-air-for-linux-axed
|
||||
[5]:ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
|
@ -1,8 +1,6 @@
|
||||
恰当地管理开源,让软件更加安全
|
||||
================================================================================
|
||||
![作者 Bill Ledingham 是 Black Duck Software 公司的首席技术官(CTO)兼工程执行副总裁](http://www.linux.com/images/stories/41373/Bill-Ledingham.jpg)
|
||||
|
||||
Bill Ledingham 是 Black Duck Software 公司的首席技术官(CTO)兼工程执行副总裁。
|
||||
<center>![作者 Bill Ledingham 是 Black Duck Software 公司的首席技术官(CTO)兼工程执行副总裁](http://www.linux.com/images/stories/41373/Bill-Ledingham.jpg)</center>
|
||||
|
||||
越来越多的公司意识到,要想比对手率先开发出高质量具有创造性的软件,关键在于积极使用开源项目。软件版本更迭要求市场推广速度足够快,成本足够低,而仅仅使用商业源代码已经无法满足这些需求了。如果不能选择最合适的开源软件集成到自己的项目里,一些令人称道的点子怕是永无出头之日了。
|
||||
|
||||
@ -38,12 +36,9 @@ Heartbleed bug 让开发人员和企业知道了软件安全性有多重要。
|
||||
|
||||
虽然每个公司、每个开发团队都面临各不相同的问题,但实践证明下面几条安全管理经验对使用开源软件的任何规模的组织都有意义:
|
||||
|
||||
- **自动认证并分类** - 捕捉并追踪开源组件的相关属性,评估授权许可,自动扫描可能出现的安全漏洞,自动认证并归档。
|
||||
-
|
||||
- **维护最新代码的版本** - 评估代码质量,确保你的产品使用的是最新版本的代码。
|
||||
-
|
||||
- **自动批准和分类** - 捕捉并追踪开源组件的相关属性,评估许可证合规性,通过自动化扫描、批准和使用过程来审查可能出现的安全漏洞。
|
||||
- **维护最新代码的版本** - 评估代码质量,确保你的产品使用的是最新版本的代码。
|
||||
- **评估代码** - 评估所有在使用的开源代码;审查代码安全性、授权许可、列出风险并予以解决。
|
||||
-
|
||||
- **确保代码合法** - 创建并实现开源政策,建立自动化合规检查流程确保开源政策、法规、法律责任等符合开源组织的要求。
|
||||
|
||||
### 关键是,要让管理流程运作起来 ###
|
||||
@ -58,7 +53,7 @@ via: http://www.linux.com/news/software/applications/782953-how-to-achieve-bette
|
||||
|
||||
作者:[Bill Ledingham][a]
|
||||
译者:[sailing](https://github.com/sailing)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,121 +0,0 @@
|
||||
wangjiezhe translating
|
||||
|
||||
Using GIT to backup your website files on linux
|
||||
================================================================================
|
||||
![](http://techarena51.com/wp-content/uploads/2014/09/git_logo-1024x480-580x271.png)
|
||||
|
||||
Well not exactly Git but a software based on Git known as BUP. I generally use rsync to backup my files and that has worked fine so far. The only problem or drawback is that you cannot restore your files to a particular point in time. Hence, I started looking for an alternative and found BUP a git based software which stores your data in repositories and gives you the option to restore data to a particular point in time.
|
||||
|
||||
With BUP you will first need to initialize an empty repository, then take a backup of all your files. When BUP takes a backup it creates a restore point which you can later restore to. It also creates an index of all your files, this index contains file attributes and checksum. When another backup is scheduled BUP compares the files with this attribute and only saves data if anything has changed. This saves you a lot of space.
|
||||
|
||||
### Installing BUP (Tested on Centos 6 & 7) ###
|
||||
|
||||
Ensure you have RPMFORGE and EPEL repos installed.
|
||||
|
||||
[techarena51@vps ~]$sudo yum groupinstall "Development Tools"
|
||||
[techarena51@vps ~]$ sudo yum install python python-devel
|
||||
[techarena51@vps ~]$ sudo yum install fuse-python pyxattr pylibacl
|
||||
[techarena51@vps ~]$ sudo yum install perl-Time-HiRes
|
||||
[techarena51@vps ~]$ git clone git://github.com/bup/bup
|
||||
[techarena51@vps ~]$cd bup
|
||||
[techarena51@vps ~]$ make
|
||||
[techarena51@vps ~]$ make test
|
||||
[techarena51@vps ~]$sudo make install
|
||||
|
||||
For debian/ubuntu users you can do “apt-get build-dep bup” on recent versions for more information check out https://github.com/bup/bup
|
||||
You may get errors on CentOS 7 at “make test”, but you can continue to run make install.
|
||||
|
||||
The first step like git is to initialize an empty repository.
|
||||
|
||||
[techarena51@vps ~]$bup init
|
||||
|
||||
By default, bup will store it’s repository under “~/.bup” but you can change that by setting the “export BUP_DIR=/mnt/user/bup” environment variable
|
||||
|
||||
Next you create an index of all files. The index, as I mentioned earlier stores a listing of files, their attributes, and their git object ids (sha1 hashes). ( Attributes include soft links, permissions as well as the immutable bit
|
||||
|
||||
bup index /path/to/file
|
||||
bup save -n nameofbackup /path/to/file
|
||||
|
||||
#Example
|
||||
[techarena51@vps ~]$ bup index /var/www/html
|
||||
Indexing: 7973, done (4398 paths/s).
|
||||
bup: merging indexes (7980/7980), done.
|
||||
|
||||
[techarena51@vps ~]$ bup save -n techarena51 /var/www/html
|
||||
|
||||
Reading index: 28, done.
|
||||
Saving: 100.00% (4/4k, 28/28 files), done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
Receiving index from server: 1268/1268, done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
|
||||
“BUP save” will split all the contents of the file into chunks and store them as objects. The “-n” option takes the name of backup.
|
||||
|
||||
You can check a list of backups as well as a list of backed up files.
|
||||
|
||||
[techarena51@vps ~]$ bup ls
|
||||
local-etc techarena51 test
|
||||
#Check for a list of backups available for my site
|
||||
[techarena51@vps ~]$ bup ls techarena51
|
||||
2014-09-24-064416 2014-09-24-071814 latest
|
||||
#Check for the files available in these backups
|
||||
[techarena51@vps ~]$ bup ls techarena51/2014-09-24-064416/var/www/html
|
||||
apc.php techarena51.com wp-config-sample.php wp-load.php
|
||||
|
||||
Backing up files on the same server is never a good option. BUP allows you to remotely backup your website files, you however need to ensure that your SSH keys and BUP are installed on the remote server.
|
||||
|
||||
bup index path/to/dir
|
||||
bup save-r remote-vps.com -n backupname path/to/dir
|
||||
|
||||
### Example: Backing up the “/var/www/html” directory ###
|
||||
|
||||
[techarena51@vps ~]$bup index /var/www/html
|
||||
[techarena51@vps ~]$ bup save -r user@remotelinuxvps.com: -n techarena51 /var/www/html
|
||||
Reading index: 28, done.
|
||||
Saving: 100.00% (4/4k, 28/28 files), done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
Receiving index from server: 1268/1268, done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
|
||||
### Restoring your Backup ###
|
||||
|
||||
Log into the remote server and type the following
|
||||
|
||||
[techarena51@vps ~]$bup restore -C ./backup techarena51/latest
|
||||
|
||||
#Restore an older version of the entire working dir elsewhere
|
||||
[techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-195827
|
||||
#Restore one individual file from an old backup
|
||||
[techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-201328/root/testbup/binfile1.bin
|
||||
|
||||
The only drawback is you cannot restore files to another server, you have to manually copy the files via SCP or even rsync.
|
||||
|
||||
View your backups via an integrated web server
|
||||
|
||||
bup web
|
||||
#specific port
|
||||
bup web :8181
|
||||
|
||||
You can run bup along with a shell script and a cron job once everyday.
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
bup index /var/www/html
|
||||
bup save -r user@remote-vps.com: -n techarena51 /var/www/html
|
||||
|
||||
BUP may not be perfect, but it get’s the job done pretty well. I would definitely like to see more development on this project and hopefully a remote restore as well.
|
||||
|
||||
You may also like to read using [inotify-tools][1] for real time file syncing.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://techarena51.com/index.php/using-git-backup-website-files-on-linux/
|
||||
|
||||
作者:[Leo G][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://techarena51.com/
|
||||
[1]:http://techarena51.com/index.php/inotify-tools-example/
|
@ -1,3 +1,4 @@
|
||||
SPccman Translating
|
||||
How to debug a C/C++ program with GDB command-line debugger
|
||||
================================================================================
|
||||
What is the worst part of coding without a debugger? Compiling on your knees praying that nothing will crash? Running the executable with a blood offering? Or just having to write printf("test") at every line hoping to find where the problem is coming from? As you probably know, there are not many advantages to coding without a debugger. But the good side is that debugging on Linux is easy. While most people use the debugger included in their favorite IDE, Linux is famous for its powerful command line C/C++ debugger: GDB. However, like most command line utilities, GDB requires a bit of training to master fully. In this tutorial, I will give you a quick rundown of GDB debugger.
|
||||
@ -168,4 +169,4 @@ via: http://xmodulo.com/gdb-command-line-debugger.html
|
||||
|
||||
[a]:http://xmodulo.com/author/adrien
|
||||
[1]:https://www.gnu.org/software/gdb/
|
||||
[2]:http://users.ece.utexas.edu/~adnan/gdb-refcard.pdf
|
||||
[2]:http://users.ece.utexas.edu/~adnan/gdb-refcard.pdf
|
||||
|
@ -1,42 +0,0 @@
|
||||
Adobe从网站上撤下了Linux PDF Reader的下载链接。
|
||||
================================================================================
|
||||
![Other PDF solutions are available on Linux](http://www.omgubuntu.co.uk/wp-content/uploads/2012/07/test-pdf.jpg)
|
||||
|
||||
Linux上的其他PDF解决方案
|
||||
|
||||
**由于该公司从网站上撤下了软件的下载链接,因此这对于任何需要在Linux上使用Adobe这家公司的PDF阅读器的人而言这事变得棘手了。**
|
||||
|
||||
由一位访问Adobe抓取app的[Reddit 用户][1]标记的,Linux版本不再与其他[支持的操作系统][2]列在一起了。
|
||||
|
||||
不知道什么时候,更不知道为什么,Linux版本被删除了,但报告在八月份才开始浮出水面。
|
||||
|
||||
这也并没有太惊讶。官方的Linux版本在2013年5月才更新,而且当时还在滞后的版本9.5.x上,而Windows和Mac版已经在v11.x。
|
||||
|
||||
### 谁在意呢?是吗 ###
|
||||
|
||||
这是一个巨大的损失么?你可能并不会这么想。毕竟Adobe Reader是一款名声不好的app。速度慢,资源密集型而且臃肿。原生的PDF阅读app像Evince和Okular提供了一流的体验而没有上面的那些缺点。
|
||||
|
||||
除开Snark,这一决定将会影响一些事。一些政府网站只能使用官方Abode应用才能完成或者提交提供的官方文档和程序。
|
||||
|
||||
Adobe把企鹅给刷了并不陌生。公司在2012年[停止Linux上flash版本的更新][3](把它留给Google去做)。[并且先前将喜爱Tux的用户从它们的跨平台运行时“Air”中排除了][4]。
|
||||
|
||||
并没有失去一切。虽然网在不再提供链接了,然而在Adobe FTP服务器上仍有Debian的安装程序。计划使用老的版本?自己承担风险且没有来自Adobe的支持。同样注意这些版本可能还有没有修复的漏洞。
|
||||
|
||||
- [下载Ubuntu版本的 Adobe Reader 9.5.5][5]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/10/adobe-reader-linux-download-pulled-website
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://www.reddit.com/r/linux/comments/2hsgq6/linux_version_of_adobe_reader_no_longer/
|
||||
[2]:http://get.adobe.com/reader/otherversions/
|
||||
[3]:http://www.omgubuntu.co.uk/2012/02/adobe-adandons-flash-on-linux
|
||||
[4]:http://www.omgubuntu.co.uk/2011/06/adobe-air-for-linux-axed
|
||||
[5]:ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
|
@ -0,0 +1,119 @@
|
||||
使用 GIT 备份 linux 上的网页
|
||||
================================================================================
|
||||
![](http://techarena51.com/wp-content/uploads/2014/09/git_logo-1024x480-580x271.png)
|
||||
|
||||
BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我使用 rsync 来备份我的文件, 而且迄今为止一直工作的很好. 唯一的不足就是无法把文件恢复到某个特定的时间点. 因此, 我开始寻找替代品, 结果发现了 BUP, 一款基于 git 的软件, 它将数据存储在一个仓库中, 并且有将数据恢复到特定时间点的选项.
|
||||
|
||||
要使用 BUP, 你先要初始化一个空的仓库, 然后备份所有文件. 当 BUP 完成一次备份是, 它会创建一个还原点, 你可以过后还原到这里. 它还会创建所有文件的索引, 包括文件的属性和验校和. 当要进行下一个备份是, BUP 会对比文件的属性和验校和, 只保存发生变化的数据. 这样可以节省很多空间.
|
||||
|
||||
### 安装 BUP (在 Centos 6 & 7 上测试通过) ###
|
||||
|
||||
首先确保你已经安装了 RPMFORGE 和 EPEL 仓库
|
||||
|
||||
[techarena51@vps ~]$ sudo yum groupinstall "Development Tools"
|
||||
[techarena51@vps ~]$ sudo yum install python python-devel
|
||||
[techarena51@vps ~]$ sudo yum install fuse-python pyxattr pylibacl
|
||||
[techarena51@vps ~]$ sudo yum install perl-Time-HiRes
|
||||
[techarena51@vps ~]$ git clone git://github.com/bup/bup
|
||||
[techarena51@vps ~]$ cd bup
|
||||
[techarena51@vps ~]$ make
|
||||
[techarena51@vps ~]$ make test
|
||||
[techarena51@vps ~]$ sudo make install
|
||||
|
||||
对于 debian/ubuntu 用户, 你可以使用 "apt-get build-dep bup". 要获得更多的信心, 可以查看 https://github.com/bup/bup
|
||||
在 CentOS 7 上, 当你运行 "make test" 时可能会出错, 但你可以继续运行 "make install".
|
||||
|
||||
第一步时初始化一个空的仓库, 就像 git 一样.
|
||||
|
||||
[techarena51@vps ~]$ bup init
|
||||
|
||||
默认情况下, bup 会把仓库存储在 "~/.bup" 中, 但你可以通过设置环境变量 "export BUP_DIR=/mnt/user/bup" 来改变设置.
|
||||
|
||||
然后, 创建所有文件的索引. 这个索引, 就像之前讲过的那样, 存储了一系列文件和它们的属性及 git 目标 id (sha1 哈希表). (属性包括了软链接, 权限和不可改变字节)
|
||||
|
||||
bup index /path/to/file
|
||||
bup save -n nameofbackup /path/to/file
|
||||
|
||||
#Example
|
||||
[techarena51@vps ~]$ bup index /var/www/html
|
||||
Indexing: 7973, done (4398 paths/s).
|
||||
bup: merging indexes (7980/7980), done.
|
||||
|
||||
[techarena51@vps ~]$ bup save -n techarena51 /var/www/html
|
||||
|
||||
Reading index: 28, done.
|
||||
Saving: 100.00% (4/4k, 28/28 files), done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
Receiving index from server: 1268/1268, done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
|
||||
"BUP save" 会把所有内容分块, 然后把它们作为对象储存. "-n" 选项指定备份名.
|
||||
|
||||
你可以查看一系列备份和已备份文件.
|
||||
|
||||
[techarena51@vps ~]$ bup ls
|
||||
local-etc techarena51 test
|
||||
#Check for a list of backups available for my site
|
||||
[techarena51@vps ~]$ bup ls techarena51
|
||||
2014-09-24-064416 2014-09-24-071814 latest
|
||||
#Check for the files available in these backups
|
||||
[techarena51@vps ~]$ bup ls techarena51/2014-09-24-064416/var/www/html
|
||||
apc.php techarena51.com wp-config-sample.php wp-load.php
|
||||
|
||||
在同一个服务器上备份文件从来不是一个好的选择. BUP 允许你远程备份网页文件, 但你必须保证你的 SSH 密钥和 BUP 都已经安装在远程服务器上.
|
||||
|
||||
bup index path/to/dir
|
||||
bup save-r remote-vps.com -n backupname path/to/dir
|
||||
|
||||
### 例子: 备份 "/var/www/html" 文件夹 ###
|
||||
|
||||
[techarena51@vps ~]$bup index /var/www/html
|
||||
[techarena51@vps ~]$ bup save -r user@remotelinuxvps.com: -n techarena51 /var/www/html
|
||||
Reading index: 28, done.
|
||||
Saving: 100.00% (4/4k, 28/28 files), done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
Receiving index from server: 1268/1268, done.
|
||||
bloom: adding 1 file (7 objects).
|
||||
|
||||
### 恢复备份 ###
|
||||
|
||||
登入远程服务器并输入下面的命令
|
||||
|
||||
[techarena51@vps ~]$bup restore -C ./backup techarena51/latest
|
||||
|
||||
#Restore an older version of the entire working dir elsewhere
|
||||
[techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-195827
|
||||
#Restore one individual file from an old backup
|
||||
[techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-201328/root/testbup/binfile1.bin
|
||||
|
||||
唯一的缺点是你不能把文件恢复到另一个服务器, 你必须通过 SCP 或者 rsync 手动复制文件.
|
||||
|
||||
通过集成的 web 服务器查看备份
|
||||
|
||||
bup web
|
||||
#specific port
|
||||
bup web :8181
|
||||
|
||||
你可以使用 shell 脚本来运行 bup, 并建立一个每日运行的定时任务
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
bup index /var/www/html
|
||||
bup save -r user@remote-vps.com: -n techarena51 /var/www/html
|
||||
|
||||
BUP 并不完美, 但它的确能够很好地完成任务. 我当然非常愿意看到这个项目的进一步开发, 希望以后能够增加远程恢复的功能.
|
||||
|
||||
你也许喜欢阅读 使用[inotify-tools][1], 一篇关于实时文件同步的文章.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://techarena51.com/index.php/using-git-backup-website-files-on-linux/
|
||||
|
||||
作者:[Leo G][a]
|
||||
译者:[wangjiezhe](https://github.com/wangjiezhe)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://techarena51.com/
|
||||
[1]:http://techarena51.com/index.php/inotify-tools-example/
|
Loading…
Reference in New Issue
Block a user