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

参与到Ubuntu的翻译中来
回复
头像
freeflying
帖子: 521
注册时间: 2005-03-26 9:38

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

#1

帖子 freeflying » 2005-04-13 22:32

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:

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:

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.
头像
firehare
帖子: 2625
注册时间: 2005-04-10 16:54
来自: 温州大学
联系:

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

#2

帖子 firehare » 2005-04-14 15:15

这篇文章文字不多,主要意思也不难理解,但比较难翻。水平有限,还是请高手看看,作点修改!

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盘中同时删除。
头像
oneleaf
论坛管理员
帖子: 10454
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#3

帖子 oneleaf » 2005-04-14 16:59

当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#4

帖子 millenniumdark » 2006-08-01 3:07

回复