显示Bareos信息的虚拟文件系统。

bareos-fuse的Python项目详细描述


显示Bareos信息的虚拟文件系统

使用

# bareos-fuse.py --help

Bareos Fuse filesystem: displays files from Bareos backups as a (userspace) filesystem.

bareos-fuse.py [mountpoint] [options]

Options:
  -h, --help             show this help message and exit
  -o opt,[opt...]        mount options
  -o address=BAREOS_DIRECTOR
                         address of the Bareos Director to connect [default:
                         "localhost"]
  -o port=PORT           address of the Bareos Director to connect [default:
                         "9101"]
  -o dirname=NAME        name of the Bareos Director to connect [default:
                         ""]
  -o name=NAME           name of the Bareos Named Console
  -o password=PASSWORD   password to authenticate at Bareos Director
  -o restoreclient=client
                         Bareos client used to restore files
  -o restorepath=PATH    path prefix to restore files [default:
                         "/var/cache/bareosfs/"]
  -o logfile=FILENAME    if given, log to FILENAME

通过Bareos默认控制台装载bareosfs(无控制台名称):

^{pr2}$

显示作业列表

# ls -la /mnt/jobs/all/
drwxr-xr-x  5 root root 4096 Apr 23 22:12 jobid=128_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:12 jobid=129_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:15 jobid=131_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:12 jobid=133_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:17 jobid=135_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:18 jobid=137_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:15 jobid=139_level=F_status=T
drwxr-xr-x  5 root root 4096 Apr 23 22:17 jobid=141_level=F_status=T
...

显示卷,包括大小和状态

# ls -la /mnt/volumes/
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0001
-r--r-----  1 root root 1073693339 Sep 18 09:00 Full-0001=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0002
-r--r-----  1 root root 1073678209 Sep 18 15:00 Full-0002=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0003
-r--r-----  1 root root 1073685404 Sep 18 18:00 Full-0003=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0004
-r--r-----  1 root root 1073728529 Sep 19 12:00 Full-0004=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0005
-r--r-----  1 root root 1073709366 Sep 19 18:00 Full-0005=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0006
-r--r-----  1 root root 1073729642 Sep 20 15:00 Full-0006=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0007
-r--r-----  1 root root 1073702045 Sep 20 18:00 Full-0007=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0008
-r--r-----  1 root root 1073712528 Sep 21 12:00 Full-0008=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0009
-r--r-----  1 root root 1073684834 Sep 21 15:00 Full-0009=Full
drwxr-xr-x  5 root root       4096 Jan  1  1970 Full-0010
-rw-rw----  1 root root  732319090 Sep 22 15:00 Full-0010=Append

显示备份中的内容(文件/目录)

# ls -la /mnt/clients/client1-fd/backups/jobid\=887_level\=F_status\=T/data/
...

从备份作业还原文件

触发还原是使用扩展属性实现的。 这可以防止正常的读取访问触发还原作业。 要触发还原,请将文件或目录的扩展属性user.bareos.do设置为restore。在

注意:
  • 此操作需要mount参数restoreclient。否则会出现EPERM错误。在
  • 如果定义了多个还原作业,则需要mount参数restorejob。在

恢复完整备份作业的所有文件的示例:

#cd /mnt/clients/client1-fd/backups/jobid\=887_level\=F_status\=T/data/
# getfattr -d .
user.bareos.do
user.bareos.do_options="mark | restore"
user.bareos.restored="no"
user.bareos.restorepath="/var/cache/bareosfs//jobid=887"
# setfattr -n user.bareos.do -v restore .
# getfattr -d .
user.bareos.do="restore"
user.bareos.do_options="mark | restore"
user.bareos.restore_job_id="913"
user.bareos.restored="yes"
user.bareos.restorepath="//var/cache/bareosfs//jobid=887"

文件现在是可读的,链接显示那里的目的地。在

您可以在单个文件上设置“restore”值,而不是从备份中还原所有文件和目录。 每个集合将触发一个单独的还原作业。在

备选方案:mount命令

baroes-fuse包也包含mount.bareosfs链接。 使用此命令,可以使用normal mount命令:

mount -t bareosfs -o address=localhost,password=secret,logfile=/var/log/bareosfs.log fuse /mnt

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何为ConcurrentHashMap使用并设置适当的并发级别?   java泛型方法,运行时错误,   java在页面上显示加载的图像   java Paypal定期直接支付问题   java如何延迟重新绘制组件   JavaSpringBoot+Hibernate如何维护@Transient字段   java在其方法中获取关于类的信息   在java中将别名添加到枚举   java如何解决向google报告成绩时“需要重新连接客户端”的问题   清晰的java图像背景   java未找到适合JDateChooser的构造函数(字符串、字符串、字符)   java LRU缓存实现。某些测试用例的代码失败   if语句Java嵌套的if/Else条件   java JSoup“wrap”并非每次都按预期工作   Java Spring引导循环依赖于一个环境   ssl证书无法通过Java和IntelliJ连接到SOAP服务   带整数验证的Java扫描器   java在Flex中呈现具有动态列的datagrid   java Android:通过用户选择的选项将文件上载到服务器   子类中的java抛出错误、异常和运行时异常