Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-09-18 16:54:35 +08:00
commit d8b888ed12
10 changed files with 801 additions and 124 deletions

View File

@ -1,24 +1,24 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12624-1.html)
[#]: subject: (Best Free Online Markdown Editors That Are Also Open Source)
[#]: via: (https://itsfoss.com/online-markdown-editors/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
免费开源在线 Markdown 编辑器
免费开源在线 Markdown 编辑器
======
[Markdown][1] 是一种有用的轻量级[标记语言][2],很多人喜欢用它来编写文档或网页发布。很多人都使用 Markdown 来写文章。
[Markdown][1] 是一种有用的轻量级[标记语言][2],很多人喜欢用它来编写文档或网页发布。很多人都使用 Markdown 来写文章。
有[几个适用于 Linux 的 Markdown 编辑器][3],你可以安装并使用。
但是,如果你不想在你的系统上安装另一个程序怎么办?也许你暂时使用一个系统,无法安装一个应用程序?也许你只是想要一个能让你实时协作的标记编辑器?
但是,如果你不想在你的系统上安装另一个程序怎么办?也许你暂时使用的系统无法安装一个应用程序?也许你只是想要一个能让你实时协作的 Markdown 编辑器?
无论你的需求是什么,在线 Markdown 编辑器通过提供协作功能、发布集成、笔记同步和一些在线功能,让很多事情变得简单。
因此,我整理了一份最好的在线 Markdown 编辑器列表。
因此,我整理了一份在线 Markdown 编辑器列表。
### 免费的在线 Markdown 编辑器
@ -32,9 +32,9 @@
[StackEdit][5] 是目前最流行的开源在线 Markdown 编辑器之一。
它提供了一个很好的用户界面,并提供了一堆有用的功能。协作能力、同步能力,以及能够将你的文件发布/保存到 BloggerWordPressGitHub 和其他一些服务是 StackEdit 的一些关键功能。
它提供了一个很好的用户界面,并一堆有用的功能。协作能力、同步能力,以及能够将你的文件发布/保存到 Blogger、WordPress、GitHub 和其他一些服务是 StackEdit 的一些关键功能。
不要忘了,你还可以得到一个扩展的 Markdown 支持一些可用的扩展,以支持 LaTeX 数学表达式UML 图等。它呈现了一个所见即所得的编辑器,让你轻松使用 Markdown。它还可以离线工作并提供了一个 chrome 应用程序和扩展,如果你要的话
不要忘了,你还可以使用一些 Markdown 扩展来支持 LaTeX 数学表达式、UML 图等。它的界面是一个所见即所得的编辑器,可以让你轻松使用 Markdown。它还可以离线工作如果你需要的话它还提供了一个 chrome 应用程序和扩展
在 StackEdit 上导入/导出文件也很容易。如果你需要在你的服务器上托管它,你可以看看它在 [GitHub][6] 上的源代码,了解更多细节。
@ -44,9 +44,9 @@
![][8]
Dillinger 是一个有趣的开源在线 Markdown 编辑器。与 StackEdit 类似,你也可以与 Dropbox、GitHub、Medium、Google Drive、Bitbucket 和 OneDrive 链接并保存文件。
Dillinger 是一个有趣的开源在线 Markdown 编辑器。与 StackEdit 类似,你也可以与 Dropbox、GitHub、Medium、Google Drive、Bitbucket 和 OneDrive 链接并保存文件。
你也可以选择在需要时简单地导入/导出文件。Dillinger 的用户界面比你在 StackEdit 上看到的更简单,但它也能达到工作的目的。与 StackEdit 不同的是,你可能得不到带有 LaTeX 表达式或图表的扩展 Markdown 支持,但如果你只是需要简单的在线 Markdown 编辑器,这是一个不错的选择。
你也可以选择在需要时简单地导入/导出文件。Dillinger 的用户界面比你在 StackEdit 上看到的更简单,但它也可以工作。与 StackEdit 不同的是,你没有 LaTeX 表达式或图表的 Markdown 扩展支持,如果你只是需要一个简单的在线 Markdown 编辑器,这是一个不错的选择。
如果你需要,你可以选择将它部署在服务器上的 Docker 容器中。关于它的更多技术细节,你不妨看看它的 [GitHub 页面][9]。
@ -56,11 +56,11 @@ Dillinger 是又一个有趣的开源在线 Markdown 编辑器。与 StackEdit
![][11]
Write.as 基于同一个团队开发的自由开源软件 [WriteFreely][12],所以你可以简单地把它托管在自己的服务器上,如果你愿意的话,就可以开始免费使用它。
Write.as 基于团队开发的自由开源软件 [WriteFreely][12],所以如果你愿意的话,你可以简单地把它托管在自己的服务器上免费使用它。
你也可以使用 Write.as 服务作为一个具有基本功能的免费在线 Markdown 编辑器。为了使它发挥最大的作用,你可能想选择一份订阅。一些付费功能包括自定义主题、新闻通讯、照片托管和多个博客。
你也可以使用 Write.as 服务作为一个具有基本功能的免费在线 Markdown 编辑器。为了使它发挥最大的作用,你可能想选购一份付费订阅。付费的功能包括自定义主题、新闻通讯、照片托管和多个博客等等
它支持 Markdown可以让 [Mastodon][13]、[ActivityPub][14] 和 [Pleroma][15] 上的任何人轻松关注和分享你的博客文章。
它支持 Markdown可以让 [Mastodon][13]、[ActivityPub][14] 和 [Pleroma][15] 上的任何人轻松关注和分享你的博客文章。
你可以在它的 [GitHub 页面][16]上探索更多关于 WriteFreely 的信息,或者使用 Write.as 开始。
@ -70,11 +70,11 @@ Write.as 基于同一个团队开发的自由开源软件 [WriteFreely][12]
![][18]
一个有趣的开源 Markdown 编辑器,如果你有需要,还可以嵌入到自己的网页上。
这是一个有趣的开源 Markdown 编辑器,还可以嵌入到自己的网页上。
它支持实时预览、GitHub 风格的 Markdown还呈现了一个所见即所得的编辑器以及一堆有用的功能。除了基本的 Markdown 支持外,它还支持 emojis、LaTeX 表达式、Flowchart 等。
它支持实时预览、GitHub 风格的 Markdown它有一个所见即所得的编辑器以及一堆有用的功能。除了基本的 Markdown 支持外,它还支持表情符、LaTeX 表达式、流程图等。
你也可以选择自己托管来配置。更多信息请看它的 [GitHub 页面][19]。
你也可以选择自己托管更多信息请看它的 [GitHub 页面][19]。
- [Editor.md][20]
@ -82,11 +82,11 @@ Write.as 基于同一个团队开发的自由开源软件 [WriteFreely][12]
![][21]
CodiMD 从一开始就不是一个成熟的在线服务。但是,它是一个开源项目,通过给你在服务器上托管的能力,让你可以实时协作文档或笔记。
CodiMD 从一开始就不是一个成熟的在线服务。但是,它是一个开源项目,通过托管在服务器上,你可以实时协作文档或笔记。
它基于 [HackMD][22] 的源代码,并提供了一个[演示实例][23]来测试。我个人很喜欢它还提供了一个黑暗模式,而且很容易使用。
它基于 [HackMD][22] 的源代码,并提供了一个[演示实例][23]来提供测试。我个人很喜欢它还提供了一个黑暗模式,而且很容易使用。
对于它未来的发布(在写这篇文章的时候),它将改名为 “HedgeDoc”。
对于它未来的发布版本(在写这篇文章的时候),它将改名为 “HedgeDoc”。
你可以在它的 [GitHub 页面][24]上找到所有关于通过 Docker/Kubernetes 在服务器上部署它的相关信息以及其他手动配置选项。
@ -96,9 +96,9 @@ CodiMD 从一开始就不是一个成熟的在线服务。但是,它是一个
![][26]
Wri.pe 是一款简单的开源在线 Markdown 编辑器,虽然已经不再维护,但它仍然活且可用。
Wri.pe 是一款简单的开源在线 Markdown 编辑器,虽然已经不再维护,但它仍然活着而且可用。
它的特点是实时预览和可选导出或保存你的笔记到 Dropbox/Evernote。考虑到它没有活跃维护,你可能不会依赖它,但当我测试它时,它的工作原理和预期一样。
它的特点是实时预览和可以导出或保存你的笔记到 Dropbox/Evernote。考虑到它没有积极维护,你可能不会依赖它,但当我测试它时,它和预期一样可以工作
你可以看看它的 [GitHub 页面][27]或官方网站来了解更多关于它的信息。
@ -112,7 +112,7 @@ Wri.pe 是一款简单的开源在线 Markdown 编辑器,虽然已经不再维
![][29]
由 Markdown 语言的创造者提供的一个简单而免费的在线 Markdown 编辑器。它并不是一个成熟的在线编辑器,也不支持导入/导出,
这是由 Markdown 语言的创造者提供的一个简单而免费的在线 Markdown 编辑器。它并不是一个成熟的在线编辑器,也不支持导入/导出,
但是,如果你只是想要一个在线编辑器来预览你的 Markdown 代码,这可能是一个不错的选择。不仅仅局限于编辑器,你还可以在网站的侧边栏得到一个语法速查表。所以,你也可以在这里尝试和学习。
@ -122,19 +122,19 @@ Wri.pe 是一款简单的开源在线 Markdown 编辑器,虽然已经不再维
![][31]
[Markdown Journal][32] 是 [GitHub][33] 上的一个有趣的开源项目,但已经停止了。它让你能够使用它的在线编辑器用 Markdown 语言创建日记,并直接保存在你的 Dropbox 账户上。当我试图创建日志时,我注意到内部服务器错误,但你可以看看它。
[Markdown Journal][32] 是 [GitHub][33] 上的一个有趣的开源项目,但已经停止开发了。你可以通过它的在线编辑器使用 Markdown 语言创建日记,并直接保存在你的 Dropbox 账户上。当我试图创建日志时,我注意到发生了内部服务器错误,但你可以了解一下它。
#### Etherpad
![][34]
[Etherpad][35] 是另一个令人印象深刻的开源在线编辑器,但它并没有开箱即用的 Markdown 支持。你可能会注意到一些插件可以在你的服务器上启用 Markdown 编辑,但那还不是完美无缺的东西。所以,你可能要留意一下它。有一个[公共实例][36]的列表,也可以尝试一下。
[Etherpad][35] 是另一个令人印象深刻的开源在线编辑器,但它并没有开箱即用的 Markdown 支持。你可能会注意到通过一些插件可以在你的服务器上启用 Markdown 编辑,但还不够完美。所以,你可能要注意一点。它有一个[公共实例][36]的列表,也可以尝试一下。
### 总结
考虑到很多在线编辑器、CMS 和记事本服务都支持 Markdown如果你想把它发布到网上,像 [WordPress][37] 这样的服务/应用也是一个不错的选择。
考虑到很多在线编辑器、CMS 和记事本服务都支持 Markdown如果你想把它发布到网上,像 [WordPress][37] 这样的服务/应用也是一个不错的选择。
你更喜欢用哪个作为 Markdown 编辑器?我是否错过了你最喜欢的东西?请在下面的评论中告诉我
你更喜欢用哪个 Markdown 编辑器?我是否错过了你最喜欢的东西?请在下面的评论中告诉我
--------------------------------------------------------------------------------
@ -143,7 +143,7 @@ via: https://itsfoss.com/online-markdown-editors/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,93 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Incremental backups with Btrfs snapshots)
[#]: via: (https://fedoramagazine.org/btrfs-snapshots-backup-incremental/)
[#]: author: (Alessio https://fedoramagazine.org/author/alciregi/)
Incremental backups with Btrfs snapshots
======
![][1]
Snapshots are an interesting feature of Btrfs. A snapshot is a copy of a subvolume. Taking a snapshot is immediate. However, taking a snapshot is not like performing a _rsync_ or a _cp_, and a snapshot doesnt occupy space as soon as it is created.
Editors note: From the [BTRFS Wiki][2] A snapshot is simply a subvolume that shares its data (and metadata) with some other subvolume, using Btrfss COW capabilities.
Occupied space will increase alongside the data changes in the original subvolume or in the snapshot itself, if it is writeable. Added/modified files, and deleted files in the subvolume still reside in the snapshots. This is a convenient way to perform backups.
### Using snapshots for backups
A snapshot resides on the same disk where the subvolume is located. You can browse it like a regular directory and recover a copy of a file as it was when the snapshot was performed. By the way, a snapshot on the same disk of the snapshotted subvolume is not an ideal backup strategy: if the hard disk broke, snapshots will be lost as well. An interesting feature of snapshots is the ability to send them to another location. The snapshot can be sent to an external hard drive or to a remote system via SSH (the destination filesystems need to be formatted as Btrfs as well). To do this, the commands _btrfs send_ and _btrfs receive_ are used.
### Taking a snapshot
In order to use the _send_ and the _receive_ commands, it is important to create the snapshot as read-only, and snapshots are writeable by default.
The following command will take a snapshot of the _/home_ subvolume. Note the _-r_ flag for readonly.
sudo btrfs subvolume snapshot -r /home /.snapshots/home-day1
Instead of day1, the snapshot name can be the current date, like _home-$(date +%Y%m%d)_. Snapshots look like regular subdirectories. You can place them wherever you like. The directory _/.snapshots_ could be a good choice to keep them neat and to avoid confusion.
Editors note: Snapshots will not take recursive snapshots of themselves. If you create a snapshot of a subvolume, every subvolume or snapshot that the subvolume contains is mapped to an empty directory of the same name inside the snapshot.
### Backup using btrfs send
In this example the destination Btrfs volume in the USB drive is mounted as _/run/media/user/mydisk/bk_ . The command to send the snapshot to the destination is:
sudo btrfs send /.snapshots/home-day1 | sudo btrfs receive /run/media/user/mydisk/bk
This is called initial bootstrapping, and it corresponds to a full backup. This task will take some time, depending on the size of the _/home_ directory. Obviously, subsequent incremental sends will take a shorter time.
### Incremental backup
Another useful feature of snapshots is the ability to perform the send task in an incremental way. Lets take another snapshot.
sudo btrfs subvolume snapshot -r /home /.snapshots/home-day2
In order to perform the send task incrementally, you need to specify the previous snapshot as a base and this snapshot has to exist in the source and in the destination. Please note the _-p_ option.
sudo btrfs send -p /.snapshot/home-day1 /.snapshot/home-day2 | sudo btrfs receive /run/media/user/mydisk/bk
And again (the day after):
sudo btrfs subvolume snapshot -r /home /.snapshots/home-day3
sudo btrfs send -p /.snapshot/home-day2 /.snapshot/home-day3 | sudo btrfs receive /run/media/user/mydisk/bk
### Cleanup
Once the operation is complete, you can keep the snapshot. But if you perform these operations on a daily basis, you could end up with a lot of them. This could lead to confusion and potentially a lot of used space on your disks. So it is a good advice to delete some snapshots if you think you dont need them anymore.
Keep in mind that in order to perform an incremental send you need at least the last snapshot. This snapshot must be present in the source and in the destination.
sudo btrfs subvolume delete /.snapshot/home-day1
sudo btrfs subvolume delete /.snapshot/home-day2
sudo btrfs subvolume delete /run/media/user/mydisk/bk/home-day1
sudo btrfs subvolume delete /run/media/user/mydisk/bk/home-day2
Note: the day 3 snapshot was preserved in the source and in the destination. In this way, tomorrow (day 4), you can perform a new incremental _btrfs send_.
As some final advice, if the USB drive has a bunch of space, you could consider maintaining multiple snapshots in the destination, while in the source disk you would keep only the last one.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/btrfs-snapshots-backup-incremental/
作者:[Alessio][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/alciregi/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/08/butterfs-816x346.png
[2]: https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Snapshots

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (tanslating)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,277 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Update devices remotely with this open source tool)
[#]: via: (https://opensource.com/article/20/9/update-remote-devices-updatehub)
[#]: author: (Domarys https://opensource.com/users/domarys)
Update devices remotely with this open source tool
======
Handle all your complete device updates, including firmware and
bootloaders, over the air with UpdateHub Community Edition.
![Working from home at a laptop][1]
The ability to access, connect, and [manage multiple devices remotely][2] through a single account is important. Going a step further, being able to completely update devices remotely is another way for sysadmins to reduce effort and minimize headaches.
[UpdateHub][3] is an open source solution that allows you to do complete device updates, including firmware and bootloaders, remotely. Its goal is to make it easier to do device updates and reduce rework and risk, whether you're updating thousands of devices or managing small deployments. UpdateHub handles all aspects of over-the-air (OTA) updates, including package integrity and authenticity, while you take care of your other work.
This step-by-step guide to UpdateHub aims to help you get started with this professional tool. There are two UpdateHub server options: [UpdateHub Cloud][4] and [UpdateHub Community Edition][3] (UpdateHub CE), a fully open source server (distributed under the MIT License), which is what this tutorial uses.
### Check the requirements
First, make sure your Linux distribution has installed all [the required packages][5] to build an image using the Yocto Project.
You also need the following hardware:
* **Target** is the development device. This tutorial uses a [Raspberry Pi 3 Model B+][6], but you could also use a Raspberry Pi 3, Model B, or Model B+.
* **Host** is the computer where you will build the image using the Yocto Project. This tutorial uses [Yocto 3.1 Dunfell][7].
To start UpdateHub CE, you must have [Docker][8] installed on the host. If you don't have it, see Docker's [orientation and setup][9] instructions.
This tutorial uses Google's [repo tool][10] to facilitate the process, as it requires multiple repositories. You can learn more about repo in the [Android development setup guide][11].
On Debian and Ubuntu distros, install repo with:
```
`sudo apt install repo`
```
If you're using another Linux distribution, download repo directly and set your distro with:
```
mkdir ~/bin
curl <http://commondatastorage.googleapis.com/git-repo-downloads/repo> &gt; ~/bin/repo
chmod a+x ~/bin/repo
PATH=${PATH}:~/bin
```
Finally, you need network connectivity via [DHCP][12], or you must know how to change the internet protocol (IP) address or to create a Yocto Project layer that handles this configuration.
### Prepare your environment for the build
UpdateHub provides a repository with a manifest file used by the repo tool, which makes it easier to manage multiple layers.
Download the source code by creating a directory and fetching the necessary Yocto Project layers:
```
mkdir updatehub-platform
cd updatehub-platform
repo init -u <https://github.com/UpdateHub/updatehub-yocto-project-reference-platform.git> -b dunfell
repo sync
```
After the `repo sync` command completes, you will see all the layers you need in the `sources` directory.
The UpdateHub platform provides support for multiple [supported devices][13]. During the Yocto Project environment setup, it will ask if you want to accept the end-user license agreement (EULA) of the `meta-freescale` layer; this is not necessary for this project.
Load the Yocto Project environment:
```
`MACHINE="raspberrypi3" source ./setup-environment build`
```
Note that this command is valid only for the terminal session where you loaded the environment. If you use a new terminal, you will need to load the environment again. However, you won't need to configure the machine again because the configuration content is stored in the `conf/local.conf` file.
### Start UpdateHub CE
With Docker installed, download the Docker image and start the server on port 8080:
```
`docker run -d -p 8080:8080 updatehub/updatehub-ce:latest`
```
![Installing and running the server with Docker image][14]
(Domarys Correa, [CC BY-SA 4.0][15])
Access the UpdateHub CE dashboard through the host IP address and port 8080 (`http://IP_ADDRESS:8080`). The host IP in the example is 192.168.15.50, so that would be `http://192.168.15.50:8080`.
Use the default of `admin` for the login and password, and click **Login**.
You need to configure the `UPDATEHUB_SERVER_URL` to use the UpdateHub CE address because the device needs to know the server's IP address. By default, the `meta-updatehub` layer uses the UpdateHub Cloud address in the server URL variable.
You should see UpdateHub CE's main interface:
![Accessing the UpdateHub CE dashboard][16]
(Domarys Correa, [CC BY-SA 4.0][15])
### Configure the environment to generate the image
The next step is to generate the Linux image that will be used by the device. But first, you need to set up some variables in the `conf/local.conf` file:
```
UPDATEHUB_SERVER_URL = "<http://IP\_ADDRESS:8080>"
UPDATEHUB_PACKAGE_VERSION_SUFFIX = "-test-image-1"
ENABLE_UART = "1"
UPDATEHUB_POLLING_INTERVAL = "1m"
```
Going line by line in the above code:
* `UPDATEHUB_SERVER_URL` contains the IP address where UpdateHub CE is running.
* `UPDATEHUB_PACKAGE_VERSION_SUFFIX` adds a suffix in the image version. This is useful for placing a version number and incrementing it for each new image. This variable will be the `VERSION_ID`, which is composed of the `DISTRO_VERSION` (described in the [docs][17]) plus the `UPDATEHUB_PACKAGE_VERSION_SUFFIX`. You can verify this in the `/etc/os-release` file in the target.
* `ENABLE_UART`: There are several ways to access the target device, such as using the serial console or connecting a keyboard and a monitor. This variable allows access to a serial console on a Raspberry Pi by using the serial ports available on the GPIO header.
* `UPDATEHUB_POLLING_INTERVAL`: By default, communication between UpdateHub's agent and server happens every 24 hours. Use this variable to set up a new consultation time of 1 minute.
This tutorial uses [Minicom][18] to connect with the target; if you want, you can learn more about [using the serial connection in Raspberry Pi][19].
### Generate the image
Now that the Yocto Project environment is ready, compile the image using the [BitBake][20] task-execution engine by running:
```
`bitbake updatehub-image-base`
```
Image generation can take a while, depending on the host machine. If this is the first time you are building an image for `raspberrypi3` in Yocto's Dunfell branch, BitBake will download the entire source code, so your download speed will influence the time it takes to generate the image.
Once the image is compiled, navigate to the `build/tmp/deploy/images/raspberrypi3/` host directory and verify the image file, `updatehub-image-minimal-raspberrypi3.wic.gz`, is there.
Insert an SD card into your Raspberry Pi and check its name by running `dmesg`. Then flash the image to your SD card with the following command, but make sure to change `/dev/sdX` to your SD card name:
```
`zcat updatehub-image-base-raspberrypi3.wic.gz | sudo dd of=/dev/sdX`
```
Insert the imaged SD card into the target device to connect to Raspberry Pi. The image has a network configured to obtain an IP address using DHCP. Access the console with user `root` and leave the password empty.
Confirm the version of the image running on the target using `cat /etc/os-release`.
![Viewing a version of the image with Minicom][21]
(Domarys Correa, [CC BY-SA 4.0][15])
### Generate the update package
Your device should be running and working correctly, but you need to add the feature to create an update package. This creates an image to update your target. The following example adds support for an SSH server on the target and creates an update package to install this functionality.
Add support for the OpenSSH server by adding the following line to the `build/conf/local.conf` file:
```
`IMAGE_FEATURES += "ssh-server-openssh"`
```
To make it clear that the updated image will have another version, put the suffix `-test-image-2` in the `UPDATEHUB_PACKAGE_VERSION_SUFFIX` variable:
```
`UPDATEHUB_PACKAGE_VERSION_SUFFIX = "-test-image-2"`
```
Save the file and run:
```
`bitbake updatehub-image-base -c uhuarchive`
```
This command generates a file with a `.uhupkg` extension, a format used by UpdateHub to update the system. The generated file will be in the same directory as the images are, `tmp/deploy/images/raspberrypi3`; in this example, that's `updatehub-image-base-raspberrypi3.uhupkg`.
### Check your device
To access the UpdateHub CE dashboard, click the **Devices** tab to see if your device is listed:
![Device section on the UpdateHub CE][22]
(Domarys Correa, [CC BY-SA 4.0][15])
### Send an update package
UpdateHub CE dashboard's **Packages** tab shows a list of available packages, but you do not have any yet. To add a package, click the **Upload Package** button, and select the `updatehub-image-minimal-raspberrypi3.uhupkg` file. In this example, it is in `tmp/deploy/images/raspberrypi3/directory`. A screen showing the package details will appear. This shows the process of adding an update package to the dashboard:
![Add an update package][23]
(Domarys Correa, [CC BY-SA 4.0][15])
### Create a rollout
With the device recognized and the packet sent to the server, you can create a rollout, which is essentially a deployment plan. Navigate to the **Rollouts** tab and click **Create Rollout**. Choose which package version you want to use in the upgrade. This example only has the package from the previous step, with version `20.04-test-image-2`. Choose this version, and make sure it includes the list of devices that will be updated.
![Creating a rollout and checking the device update][24]
(Domarys Correa, [CC BY-SA 4.0][15])
Previously, you configured the image running on the target to perform an update query on the UpdateHub server every minute, so within one minute of creating the rollout, the update process will start. To track the update status, check the **Rollouts** tab.
![The update process][25]
(Domarys Correa, [CC BY-SA 4.0][15])
After finishing an upgrade process, the target reboots automatically. The new image boots up and automatically queries the server for updates. The server responds that it does not have any updates and ends the update cycle.
When the status shows `updated`, run the command below on the host to access the target over SSH:
```
`ssh root@IP_DO_TARGET`
```
No password is required; just press **Enter**, and you will be in the target console. You can check the version in the `/etc/os-release` file to confirm.
### Congratulations! You're done!
Now you have access to a professional tool to update your devices remotely. This tutorial used a Raspberry Pi 3 with the Yocto Project version Dunfell 3.1.2, but [other devices and versions][13] are supported.
If you have any questions about integrating your device, access the developers' team through [Gitter][26] or by emailing [contact@updatehub.io][27].
* * *
_This article is based on [UpdateHub: Sending OTA Updates using the Yocto Project][28] on UpdateHub's blog._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/9/update-remote-devices-updatehub
作者:[Domarys][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/domarys
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
[2]: https://opensource.com/article/20/7/linux-shellhub
[3]: https://github.com/UpdateHub/updatehub-ce
[4]: https://updatehub.io/
[5]: https://www.yoctoproject.org/docs/2.6.1/mega-manual/mega-manual.html#required-packages-for-the-build-host
[6]: https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/
[7]: https://old.yoctoproject.org/yoctoproject/dunfell
[8]: https://www.docker.com/
[9]: https://docs.docker.com/get-started/
[10]: https://gerrit.googlesource.com/git-repo/+/refs/heads/master/README.md
[11]: https://source.android.com/setup/develop
[12]: https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
[13]: https://docs.updatehub.io/yocto-project/supported-machines/
[14]: https://opensource.com/sites/default/files/uploads/yocto1_installserver.gif (Installing and running the server with Docker image)
[15]: https://creativecommons.org/licenses/by-sa/4.0/
[16]: https://opensource.com/sites/default/files/uploads/yocto2_updatehubce-dashboard.gif (Accessing the UpdateHub CE dashboard)
[17]: https://www.yoctoproject.org/docs/2.6.1/ref-manual/ref-manual.html#var-DISTRO_VERSION
[18]: https://wiki.emacinc.com/wiki/Getting_Started_With_Minicom
[19]: https://elinux.org/RPi_Serial_Connection
[20]: https://github.com/openembedded/bitbake
[21]: https://opensource.com/sites/default/files/uploads/yocto_confirm.gif (Viewing a version of the image with Minicom)
[22]: https://opensource.com/sites/default/files/uploads/yocto_device-dashboard.gif (Device section on the UpdateHub CE)
[23]: https://opensource.com/sites/default/files/uploads/yocto_addupdate.gif (Add an update package)
[24]: https://opensource.com/sites/default/files/uploads/yocto6_createrollout.gif (Creating a rollout and checking the device update)
[25]: https://opensource.com/sites/default/files/uploads/yocto7.gif (The update process)
[26]: https://gitter.im/UpdateHub
[27]: mailto:contact@updatehub.io
[28]: https://blog.updatehub.io/updatehub-sending-ota-updates-using-the-yocto-project/

View File

@ -0,0 +1,125 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What's new with rdiff-backup?)
[#]: via: (https://opensource.com/article/20/9/rdiff-backup-linux)
[#]: author: (Patrik Dufresne https://opensource.com/users/patrik-dufresne)
What's new with rdiff-backup?
======
The longstanding Linux backup solution's migration to Python 3 opens
opportunity to add many new features.
![Hand putting a Linux file folder into a drawer][1]
In March 2020, [rdiff-backup][2] advanced to version 2, 11 years after the last major release. The deprecation of Python 2 at the beginning of 2020 was the impetus for this update, but it gave the development team the opportunity to incorporate other features and benefits.
For about two decades, rdiff-backup has helped Linux users maintain full backups of their data locally or remotely without needlessly draining resources. This is because the open source solution does reverse incremental backups—backing up only the files that changed from the previous backup.
The revamp (or, as some are saying, rebirth) came thanks to the efforts of a new, self-organized development team (led by Eric Zolf and Patrik Dufresne from [IKUS Software][3] and Otto Kekäläinen from [Seravo][4]) that put heads and hands together for the benefit of all rdiff-backup users.
### New features in rdiff-backup
Along with the migration to Python 3, spearheaded by Eric, the project was migrated to a new, enterprise-free [repository][5] to welcome contributions. The team also incorporated all of the patches submitted over the years, including sparse file support and a fix for hard links.
#### Automation with Travis CI
Another huge improvement is the addition of a continuous integration/continuous delivery (CI/CD) pipeline using open source [Travis CI][6]. This permits rdiff-backup testing in various environments, which ensures that changes do not affect the solution's stability. The CI/CD pipeline includes integration of builds and binary distribution for all major platforms.
#### Easy installation with yum and apt
The new rdiff-backup solution runs on all major Linux distributions, including Fedora, Red Hat, Elementary, Debian, and many more. Frank and Otto worked arduously to provide open repositories to facilitate access and installation. You can install rdiff-backup using your package manager or follow the [step-by-step instructions][7] on the GitHub project page.
#### A new home
The team migrated the website from Savannah to GitHub Pages and is revamping the official [rdiff-backup.net][2] website to include new content and make the look and feel more on point.
### How to use rdiff-backup
If you're new to rdiff-backup, you might be surprised by how easy it is to use. A backup solution needs to be non-intimidating so that you feel comfortable with the backup and restoration processes.
#### Start a backup
To initiate a backup to a local drive, such as one attached by USB, enter the `rdiff-backup` command followed by the drive you want to back up and the target directory where you want to store the files.
For example, to back up to a local drive called `my_backup_drive`, enter:
```
`$ rdiff-backup /home/tux/ /run/media/tux/my_backup_drive/`
```
To back up your data to offsite storage, use the remote server's location followed by `::` to point to the backup drive's mount point:
```
`$ rdiff-backup /home/tux/ tux@example.com::/my_backup_drive/`
```
You may need to [set up SSH keys][8] to make this process effortless.
#### Restore files
The reason to make backups is that sometimes files go missing. To make recovery as simple as possible, you don't even need rdiff-backup to restore files (although using the `rdiff-backup` command provides some conveniences).
If you need to get a file from your backup drive, you can just copy it over from the backup drive to your local system using `cp` for a local drive or `scp` for a remote drive.
For a local drive, use:
```
`$ cp _run_media/tux/my_backup_drive/Documents/example.txt \ ~/Documents`
```
Or for a remote drive:
```
`$ scp tux@example.com::/my_backup_drive/Documents/example.txt \ ~/Documents`
```
However, using the `rdiff-backup` command provides other options, including the `--restore-as-of` option. This allows you to specify which version of your file you want to rescue.
For example, suppose you want to rescue a file as it appeared four days ago:
```
`$ rdiff-backup --restore-as-of 4D \ /run/media/tux/foo.txt ~/foo_4D.txt`
```
You can also use `rdiff-backup` to grab the latest version:
```
`$ rdiff-backup --restore-as-of now \ /run/media/tux/foo.txt ~/foo_4D.txt`
```
It's that easy. Also, rdiff-backup has many other options, e.g., you can exclude files from a list, back up from one remote to another remote, and more, which you can learn about in the [documentation][9].
### Back it up
Our development team hopes users will appreciate this revamped open source rdiff-backup solution, which is the culmination of our continuous efforts. We also appreciate our contributors, who truly demonstrate the power of open source.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/9/rdiff-backup-linux
作者:[Patrik Dufresne][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/patrik-dufresne
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer)
[2]: https://rdiff-backup.net/
[3]: https://www.ikus-soft.com/en/
[4]: https://seravo.fi/english
[5]: https://github.com/rdiff-backup/rdiff-backup
[6]: https://en.wikipedia.org/wiki/Travis_CI
[7]: https://github.com/rdiff-backup/rdiff-backup#installation
[8]: https://opensource.com/article/20/8/how-ssh
[9]: https://rdiff-backup.net/docs/examples.html

View File

@ -0,0 +1,177 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Extend/Increase LVMs (Logical Volume Resize) in Linux)
[#]: via: (https://www.2daygeek.com/extend-increase-resize-lvm-logical-volume-in-linux/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
How to Extend/Increase LVMs (Logical Volume Resize) in Linux
======
Expanding the logical volume is extremely easy, it takes very few steps and can be done online without unmounting a certain logical volume.
The main purpose of LVM is flexible disk management, which allows you to easily resize, extend and reduce the logical volume size when you need it.
If you are new to Logical Volume Management (LVM), I suggest you start with our previous article.
* **Part-1: [How to Create/Configure LVM (Logical Volume Management) in Linux][1]**
![][2]
Expanding the logical volume involves the below steps.
* Check if you have sufficient unallocated disk space in the volume group where the LV was residing.
* If yes, you can use that space to extend the logical volume.
* If not, add new disks or LUNs to your system.
* Convert a physical disk as a physical volume (PV).
* Extend the Volume Group
* Increase the logical Volume
* Grow the filesystem
* Check the extended filesystem size
### How to Create LVM Physical Volumes
Create LVM physical volumes with the pvcreate command.
Once the disk is detected in the OS, use the pvcreate command to initialize the LVM PV (Physical Volumes).
```
# pvcreate /dev/sdc
Physical volume "/dev/sdc" successfully created
```
**Make a note:**
* The above command erases any data on the given disk /dev/sdc.
* Physical disk can be added directly into the LVM PV instead of the disk partition.
Use the pvdisplay command to display the PVs you have created.
```
# pvdisplay /dev/sdc
"/dev/sdc" is a new physical volume of "10.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdc
VG Name
PV Size 10.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 69d9dd18-36be-4631-9ebb-78f05fe3217f
```
### How to Extend the Volume Group
Use the following command to add a new physical volume to the existing volume group.
```
# vgextend vg01 /dev/sdc
Volume group "vg01" successfully extended
```
Use the vgdisplay command to display the PVs you have created.
```
# vgdisplay vg01
--- Volume group ---
VG Name vg01
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 14.99 GiB
PE Size 4.00 MiB
Total PE 3840
Alloc PE / Size 1280 / 4.99
Free PE / Size 2560 / 9.99 GiB
VG UUID d17e3c31-e2c9-4f11-809c-94a549bc43b7
```
### How to Extend the Logical Volume
Use the following command to increase the existing logical volume.
**Common syntax for logical volume extension (lvextend).**
```
lvextend [Additional space to be added] [Existing Logical Volume Name]
```
Use the below command to increase the existing logical volume additionally to 10GB.
```
# lvextend -L +10G /dev/mapper/vg01-lv002
Rounding size to boundary between physical extents: 5.90 GiB
Size of logical volume vg01/lv002 changed from 5.00 GiB (1280 extents) to 15.00 GiB (3840 extents).
Logical volume var successfully resized
```
To extend logical volume using PE sizes.
```
# lvextend -l +2560 /dev/mapper/vg01-lv002
```
To extend the logical volume using percentage (%), use the following command.
```
# lvextend -l +40%FREE /dev/mapper/vg01-lv002
```
Now, the logical volume is extended and you need to resize the file system to extend the space inside the logical volume.
For an ext3 and ext4 based file system, run the following command.
```
# resize2fs /dev/mapper/vg01-lv002
```
For the xfs file system, use the following command.
```
# xfs_growfs /dev/mapper/vg01-lv002
```
Use the **[df command][3]** to view the file system size.
```
# df -h /lvmtest1
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg01-lv002 15360M 34M 15326M 4% /lvmtest1
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/extend-increase-resize-lvm-logical-volume-in-linux/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/create-lvm-storage-logical-volume-manager-in-linux/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: https://www.2daygeek.com/linux-check-disk-space-usage-df-command/

View File

@ -0,0 +1,98 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Fix “Repository is not valid yet” Error in Ubuntu Linux)
[#]: via: (https://itsfoss.com/fix-repository-not-valid-yet-error-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
How to Fix “Repository is not valid yet” Error in Ubuntu Linux
======
I recently [installed Ubuntu server on my Raspberry Pi][1]. I [connected it to the Wi-Fi from Ubuntu terminal][2] and went about doing what I do after installing any Linux system which is to update the system.
When I used the sudo apt update command, it gave me an error which was kind of unique to me. It complained that release file for the repository was invalid for a certain time period.
**E: Release file for <http://ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease> is not valid yet (invalid for another 159d 15h 20min 52s). Updates for this repository will not be applied.**
Heres the complete output:
```
[email protected]:~$ sudo apt update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [111 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Reading package lists... Done
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal/InRelease is not valid yet (invalid for another 21d 23h 17min 25s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/InRelease is not valid yet (invalid for another 159d 15h 21min 2s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-backports/InRelease is not valid yet (invalid for another 159d 15h 21min 32s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease is not valid yet (invalid for another 159d 15h 20min 52s). Updates for this repository will not be applied.
```
### Fixing “release file is not valid yet” error in Ubuntu and other Linux distributions
![][3]
The reason for the error is the difference in the time on the system and the time in real world.
You see, every repository file is signed on some date and you can see this information by viewing the release file:
```
sudo head /var/lib/apt/lists/ports.ubuntu.com_ubuntu_dists_focal_InRelease
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Origin: Ubuntu
Label: Ubuntu
Suite: focal
Version: 20.04
Codename: focal
Date: Thu, 23 Apr 2020 17:33:17 UTC
Architectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x
```
Now, for some reasons, the time on my Ubuntu server was in the past and this is why Ubuntu complained that the release file is not valid yet for X many days.
If you are connected to the internet, you may **wait a few minutes for your system to synchronize the time**.
If it doesnt work, you may force the system to use local time as real time clock (hardware clock):
```
sudo timedatectl set-local-rtc 1
```
The timedatectl command enables you to configure time, date and [change timezone on Linux][4].
You shouldnt need to restart. It works immediately and you can verify it by [updating your Ubuntu system][5] again.
If the problem is solved, you may set the [real time clock][6] to use UTC (as recommended by Ubuntu).
```
sudo timedatectl set-local-rtc 0
```
**Did it fix the issue for you?**
I hope this quick tip helped you to fix this error. If you are still facing the issue, let me know in the comment section and Ill try to help you out.
--------------------------------------------------------------------------------
via: https://itsfoss.com/fix-repository-not-valid-yet-error-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/
[2]: https://itsfoss.com/connect-wifi-terminal-ubuntu/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/Repository-not-valid-yet-error-ubuntu.png?resize=800%2C450&ssl=1
[4]: https://itsfoss.com/change-timezone-ubuntu/
[5]: https://itsfoss.com/update-ubuntu/
[6]: https://www.computerhope.com/jargon/r/rtc.htm

View File

@ -0,0 +1,93 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Incremental backups with Btrfs snapshots)
[#]: via: (https://fedoramagazine.org/btrfs-snapshots-backup-incremental/)
[#]: author: (Alessio https://fedoramagazine.org/author/alciregi/)
使用 Btrfs 快照进行增量备份
======
![][1]
快照是 Btrfs 的一个有趣的功能。快照是一个子卷的副本。生成快照是立即的。然而,生成快照与执行 _rsync__cp_ 不同,快照并不是一创建就会占用空间。
编者注:来自 [BTRFS Wiki][2 ]:快照是一个简单的子卷,它使用 Btrfs 的 COW 功能与其他子卷共享其数据(和元数据)。
如果它是可写的,占用的空间将随着原始子卷或快照本身的数据变化而增加。子卷中已添加/修改的文件和已删除的文件仍然存在于快照中。这是一种方便的备份方式。
### 使用快照进行备份
快照保存在子卷所在的同一磁盘上。你可以像浏览普通目录一样浏览它,并按照生成快照时的状态恢复文件的副本。顺便说一下,在被快照子卷的同一磁盘上做快照并不是一个理想的备份策略:如果硬盘坏了,快照也会丢失。快照的一个有趣的功能是可以将快照发送到另一个位置。快照可以被发送到外部硬盘或通过 SSH 发送到远程系统(目标文件系统也需要格式化为 Btrfs。要实现这个需要使用命令 _btrfs send__btrfs receive_
### 生成快照
要使用 _send__receive_ 命令,重要的是要将快照创建为只读,而快照默认是可写的。
下面的命令将对 _/home_ 子卷进行快照。请注意 _-r_ 标志为只读。
sudo btrfs subvolume snapshot -r /home /.snapshots/home-day1
快照的名称可以是当前日期,而不是 day1比如 _home-$(date +%Y%m%d)_。快照看起来像普通的子目录。你可以把它们放在任何你喜欢的地方。目录 _/.snapshots_ 可能是一个不错的选择,以保持它们的整洁和避免混淆。
编者注:快照不会对自己进行递归快照。如果你创建了一个子卷的快照,子卷所包含的每一个子卷或快照都会被映射到快照里面的一个同名的空目录。
### 使用 btrfs send 进行备份
在本例中U 盘中的目标 Btrfs 卷被挂载为 _/run/media/user/mydisk/bk_。发送快照到目标卷的命令是:
sudo btrfs send /.snapshots/home-day1 | sudo btrfs receive /run/media/user/mydisk/bk
这被称为初始启动,它相当于一个完整的备份。这个任务需要一些时间,取决于 _/home_ 目录的大小。显然,后续的增量发送只需要更短的时间。
### 增量备份
快照的另一个有用的功能是能够以增量的方式执行发送任务。让我们再来生成一个快照。
sudo btrfs subvolume snapshot -r /home /.snapshots/home-day2
为了执行增量发送任务,需要指定上一个快照作为基础,并且这个快照必须存在于源文件和目标文件中。请注意 _-p_ 选项。
sudo btrfs send -p /.snapshot/home-day1 /.snapshot/home-day2 | sudo btrfs receive /run/media/user/mydisk/bk
再来一次(之后一天):
sudo btrfs subvolume snapshot -r /home /.snapshots/home-day3
sudo btrfs send -p /.snapshot/home-day2 /.snapshot/home-day3 | sudo btrfs receive /run/media/user/mydisk/bk
### 清理
操作完成后,你可以保留快照。但如果你每天都执行这些操作,你可能最终会有很多快照。这可能会导致混乱,并可能会在你的磁盘上使用大量的空间。因此,如果你认为你不再需要一些快照,删除它们是一个很好的建议。
请记住,为了执行增量发送,你至少需要最后一个快照。这个快照必须存在于源文件和目标文件中。
sudo btrfs subvolume delete /.snapshot/home-day1
sudo btrfs subvolume delete /.snapshot/home-day2
sudo btrfs subvolume delete /run/media/user/mydisk/bk/home-day1
sudo btrfs subvolume delete /run/media/user/mydisk/bk/home-day2
注意:第 3 天的快照被保存在源文件和目标文件中。这样,明天(第 4 天),你就可以执行新的增量 _btrfs send_
最后的建议是,如果 U 盘的空间很大,可以考虑在目标盘中保留多个快照,而在源盘中只保留最后一个快照。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/btrfs-snapshots-backup-incremental/
作者:[Alessio][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/alciregi/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/08/butterfs-816x346.png
[2]: https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Snapshots