个人工具

USB盘同步

来自Ubuntu中文

跳转至: 导航, 搜索

在您的文档和USB盘之间进行同步


原文出处:http://forum.ubuntu.org.cn/viewtopic.php?t=213

原文作者:

授权许可:

翻译人员:firehare

校对人员:

贡献者:

适用版本: 文章状态:完成


Here's a one-line script you can use in a custom application launcher on your panel. Paste the following command into the 'command' space. It uses zenity for visual feedback, and assumes your usb stick is already mounted on /media/sda1. The star of the show, of course, is rsync:

实现同步功能只需要一行脚本语句,因此您可以在您面板上添加一个自定义应用程序启动器,并将下面的命令粘贴到命令文本框中以实现该功能。该脚句假定您的USB盘已被挂载到/media/sda1上,并使用zenity显示同步进度,同步实现当然是用rsync了:(这句不太好翻,高手们给看看)

rsync -rtvz --stats /media/usbdisk/Documents/ `echo $HOME`/Documents/ | zenity --text-info --width=600 --height=600 --title="Rsync Output" 

To have your documents folder synced to usb disk, just swap the source & destination:

如果是从您的文档目录到USB盘,那么只需要交换一下源和目标目录。

rsync -rtvz --stats `echo $HOME`/Documents/ /media/usbdisk/Documents/ | zenity --text-info --width=600 --height=600 --title="Rsync Output" 

So that's two launchers you can use to organise your documents, with just one catch. If you delete a file in your documents directory (or a subdirectory thereof), you may find it turn up again there. To solve this, if you delete a file, delete it from both your usb disk and your documents foler.

因此,您可以一次性使用两个启动器来组织您的文档。如果在您文档所处的目录中删除一个文件(或子目录)的话,您也许会发现它又出现在原来的地方,为解决这个问题,如果您要删除文件的话,请同时在您的文档目录和USB盘中同时删除。