如何在未登录时运行时间移位

如何在未登录时运行时间移位

我有一个带有多个用户的 Ubuntu 20.04.4 工作站,并且我希望无论是否有人登录,时间移位都能每天运行。我今天检查了系统,发现时间移位一直失败并在日志文件中报告以下错误:

<<< snip >>>
[14:00:01] Main: load_app_config()
[14:00:01] IconManager: init()
[14:00:01] bin_path: /bin/tiubuntumeshift
[14:00:01] found images directory: /usr/share/timeshift/images
[14:00:01] base_path: (null)
[14:00:01] Main(): ok
[14:00:01] AppConsole: parse_arguments()
[14:00:01] Main: initialize_repo()
[14:00:01] backup_uuid=784c8ccd-c74b-4e9d-be70-e3a9faf81818
[14:00:01] backup_parent_uuid=
[14:00:01] Setting snapshot device from config file
[14:00:01] Main: initialize_repo(): exit
[14:00:01] AppConsole: start_application()
[14:00:01] 
[14:00:01] Snapshot device not available
[14:00:01] Device not found: UUID='784c8ccd-c74b-4e9d-be70-e3a9faf81818'
[14:00:01] exit_app()
[14:00:01] crontab -l
[14:00:01] Failed to read cron tab
[14:00:01] crontab -l
[14:00:01] Failed to read cron tab
[14:00:01] Cron task exists: /etc/cron.d/timeshift-hourly
[14:00:01] unmount_target_device()
[14:00:01] clean_logs()
[14:00:01] rm -rf '/tmp/Sst3u[14:00:01] Main: load_app_config()
[14:00:01] IconManager: init()
[14:00:01] bin_path: /bin/timeshift
[14:00:01] found images directory: /usr/share/timeshift/images
[14:00:01] base_path: (null)
[14:00:01] Main(): ok
[14:00:01] AppConsole: parse_arguments()
[14:00:01] Main: initialize_repo()
[14:00:01] backup_uuid=784c8ccd-c74b-4e9d-be70-e3a9faf81818
[14:00:01] backup_parent_uuid=
[14:00:01] Setting snapshot device from config file
[14:00:01] Main: initialize_repo(): exit
[14:00:01] AppConsole: start_application()
[14:00:01] 
[14:00:01] Snapshot device not available
[14:00:01] Device not found: UUID='784c8ccd-c74b-4e9d-be70-e3a9faf81818'
[14:00:01] exit_app()
[14:00:01] crontab -l
[14:00:01] Failed to read cron tab
[14:00:01] crontab -l
[14:00:01] Failed to read cron tab
[14:00:01] Cron task exists: /etc/cron.d/timeshift-hourly
[14:00:01] unmount_target_device()
[14:00:01] clean_logs()
[14:00:01] rm -rf '/tmp/Sst3u9bB'9bB'

当我“按需”运行 timeshift 时,我成功了。日志文件如下所示...

<<< snip >>>
[11:47:41] Main: load_app_config()
[11:47:41] App config loaded: /etc/timeshift.json
[11:47:41] IconManager: init()automatically 
[11:47:41] bin_path: /usr/bin/timeshift-gtk
[11:47:41] found images directory: /usr/share/timeshift/images
[11:47:41] Main(): ok
[11:47:41] Main: initialize_repo()
[11:47:41] backup_uuid=784c8ccd-c74b-4e9d-be70-e3a9faf81818
[11:47:41] backup_parent_uuid=
[11:47:41] Setting snapshot device from config file
[11:47:41] repo: creating from uuid
[11:47:41] SnapshotRepo: from_uuid(): RSYNC
[11:47:41] uuid=784c8ccd-c74b-4e9d-be70-e3a9faf81818
[11:47:41] SnapshotRepo: init_from_device()
<<< snip >>>

请注意,backup_UUID 是相同的。在我看来,这似乎是权限错误。备份驱动器上 timeshift 文件夹的权限为:

drwxr-xr-x 9 root root 4096 Jun 27 11:50 timeshift

我宁愿不将备份驱动器的 CHMOD 权限设置为允许所有人写入。相反,我希望在未登录时允许时间移位以适当的权限成功运行。

或者,也许这根本不是一个权限问题——我只使用 Linux 大约一年,但仍然对某些事情感到困惑。

顺便说一句,当我登录并“按需”运行 timeshift(并且它可以工作)时,我没有以 root 身份登录。我以与以下组关联的用户身份登录:

<user> adm cdrom sudo dip plugdev lpadmin sambashare HGS

针对以下评论,结果如下sudo lsblk -f

NAME        FSTYPE   LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
loop0       squashfs                                                  0   100% /snap/core/13250
loop1       squashfs                                                  0   100% /snap/core/13308
loop2       squashfs                                                  0   100% /snap/notepadqq/855
sda                                                                            
└─sda1      ext4           5deaeefe-94e6-4f95-bf29-a0794c563de9  993.7G    38% /data
sdb                                                                            
└─sdb1      ext4           784c8ccd-c74b-4e9d-be70-e3a9faf81818    3.1T    26% /run/timeshift/backup
nvme0n1                                                                        
├─nvme0n1p1 vfat           3747-AF41                             505.8M     1% /boot/efi
└─nvme0n1p2 ext4           0806f74e-4c9b-4733-93b0-4a6f2404c261  163.4G    86% /

任何意见,将不胜感激。

相关内容