ocrmypdf-auto icon indicating copy to clipboard operation
ocrmypdf-auto copied to clipboard

Please replace self.input_path.move(self.archive_path) by copying and deleting

Open noseshimself opened this issue 3 years ago • 0 comments

I tried putting the archives into another location outside the container to get them into an archive but this is resulting in

2022-12-18 22:06:53 [ThreadPoolExecutor-0_2] - Error in OcrTask.process: Traceback (most recent call last):
  File "/usr/lib/python3.8/shutil.py", line 788, in move
     os.rename(src, real_dst)
     OSError: [Errno 18] Invalid cross-device link: '/input/standard/MFC-L8650cdw_003873.pdf' -> '/archive/standard/MFC-L8650cdw_003873.pdf'

Could this be turned into copy+unlink?

move() in shutil.py should detect the cross-fs move (see

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

but something seems to have gone wrong although mount shows

/dev/nvme0n1p4 on /archive type btrfs (rw,noatime,ssd,space_cache,subvolid=262,subvol=/opt)
/dev/nvme0n1p4 on /config type btrfs (rw,noatime,ssd,space_cache,subvolid=262,subvol=/opt)
/dev/nvme0n1p4 on /input type btrfs (rw,noatime,ssd,space_cache,subvolid=262,subvol=/opt)
/dev/nvme0n1p4 on /output type btrfs (rw,noatime,ssd,space_cache,subvolid=262,subvol=/opt)
/dev/nvme0n1p4 on /ocrtemp type btrfs (rw,noatime,ssd,space_cache,subvolid=262,subvol=/opt)

noseshimself avatar Dec 18 '22 22:12 noseshimself