Duplicity在进行高效备份方面已经做得很好,但我仍然希望尽量减少要备份的文件数量。
主目录中可以排除哪些文件或目录?请明确命名这些,允许通配符,路径相对于主目录。
我my_projects_linux在 Ubuntu 文件系统内部有一个名为的目录,其中包含我多年来的所有工作。该目录包含文件、子目录等。
出于备份目的,我偶尔会将此目录及其所有内容复制到外部硬盘驱动器。
因此,我的外部驱动器的内容如下所示:
/mounted_drive/my_projects_linux
/mounted_drive/my_projects_windows # the same idea to backup Windows work
Run Code Online (Sandbox Code Playgroud)
因此,我正在寻找的是一个命令:
将作为
cp /home/my_projects_linux /mounted_drive/my_projects_linux
Run Code Online (Sandbox Code Playgroud)
它应该用我电脑上的新内容替换外部磁盘中的旧文件、子目录、子目录内的文件等。
要快。它应该只复制修改过的文件或新创建的文件。考虑到my_projects_linux> 50GB的大小,全部复制需要一个多小时,太慢了。实际上,自上次备份以来,通常只有几 MB 发生了变化,因此理论上可以更快地制作副本。
怎么做?
我在谷歌上搜索了带有-u标志的cp可能符合我的需求。这会起作用(例如,它会正确处理子目录的子目录吗)?
此外,将文件系统存储在外部磁盘上是否是一种适当的备份方式,还是有一种更好的方式?例如,使用云?请注意,更好的方法应该是简单的,否则它不会超过执行一个 shell 命令的容易程度。
我在做的时候经常出错
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
或者当我尝试安装某些应用程序时。看起来存储库已经损坏了一些东西,但是我sources.list从头开始恢复了几次并将其指向不同的服务器,但没有成功。
现在我的 sources.list 看起来像(我切换到主服务器):
1 ###### Ubuntu Main Repos
2 deb http://archive.ubuntu.com/ubuntu zesty main universe
3 deb-src http://archive.ubuntu.com/ubuntu zesty main universe
4
5 ###### Ubuntu Update Repos
6 deb http://archive.ubuntu.com/ubuntu zesty-security main universe
7
8 ###### Ubuntu Partner Repo
9 deb http://archive.canonical.com/ubuntu zesty partner
10 deb-src http://archive.canonical.com/ubuntu zesty partner
Run Code Online (Sandbox Code Playgroud)
当我更新时,我得到:
~ $ sudo apt-get update
Ign:1 http://archive.ubuntu.com/ubuntu zesty InRelease
Ign:2 http://archive.ubuntu.com/ubuntu zesty-security InRelease
Err:3 http://archive.ubuntu.com/ubuntu zesty Release
404 Not Found [IP: 91.189.88.149 80]
Hit:4 …Run Code Online (Sandbox Code Playgroud) 我运行这个 cmd 来备份我的文件夹:
$ rsync -av --exclude {/mnt/dati/Film/, /mnt/dati/Scout/} --delete /mnt/dati/ /media/cirelli/HD1TB/backup/dati
sending incremental file list
Run Code Online (Sandbox Code Playgroud)
rsync 的答案是:
rsync: link_stat "/mnt/dati/Scout/}" failed: No such file or directory (2)
Run Code Online (Sandbox Code Playgroud)
但是“Scout”目录存在!无法理解我的错误。即使胶片被复制,即使没有任何错误信息!我执行 rsync 时出了什么问题?
非常感谢各位
(哦,我已经阅读了 man https://download.samba.org/pub/rsync/rsync.html和示例http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/但还是想办法解决..!)
我也试过(这被 CTRL+C 打断了):
cirelli@asus:~$ rsync -av --exclude /mnt/dati/Film/ --exclude /mnt/dati/.Trash-1000/ --delete /mnt/dati/ /media/cirelli/HD1TB/backup/dati
sending incremental file list
deleting Documenti/script/
rsync: readlink_stat("/media/cirelli/HD1TB/backup/dati/Documenti/RPi/.2015-05-05-raspbian-wheezy.zip.2sXers") failed: Input/output error (5)
deleting Documenti/RPi/KODI/
deleting Documenti/RPi/berryboot-20130908.zip
deleting Documenti/RPi/2015-05-05-raspbian-wheezy.zip
IO error encountered -- skipping file deletion
.Trash-1000/files/
.Trash-1000/files/2015-05-05-raspbian-wheezy.zip
.Trash-1000/files/berryboot-20130908.zip
.Trash-1000/files/settembre …Run Code Online (Sandbox Code Playgroud) 我在某处读到,在使用rsync将分区从一个设备复制到另一设备后,编辑 很重要UUID,因为设备不能与相同的 UUID 共存。
这是真的吗?我该怎么做?
backup ×2
rsync ×2
17.04 ×1
apt ×1
bash ×1
command-line ×1
partitioning ×1
repository ×1
updates ×1
uuid ×1