mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
better logging
This commit is contained in:
@@ -47,7 +47,7 @@ def create_fstab():
|
|||||||
mnt_folder.mkdir(exist_ok=True, parents=True)
|
mnt_folder.mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
fstab_new.append(f'{btrfs_file} {mnt_folder} btrfs loop,ro 0 0\n')
|
fstab_new.append(f'{btrfs_file} {mnt_folder} btrfs loop,ro 0 0\n')
|
||||||
print(f' created fstab entry for {btrfs_file} -> {mnt_folder}')
|
print(f' created fstab entry for {mnt_folder}')
|
||||||
|
|
||||||
with open('/etc/fstab') as fp:
|
with open('/etc/fstab') as fp:
|
||||||
fstab_orig = [l for l in fp.readlines() if f'{config.mnt_dir}/' not in l]
|
fstab_orig = [l for l in fp.readlines() if f'{config.mnt_dir}/' not in l]
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ def auto_clean_btrfs():
|
|||||||
if len(versions_to_keep) == 1 and len(local_versions) >= 2:
|
if len(versions_to_keep) == 1 and len(local_versions) >= 2:
|
||||||
versions_to_keep.add(local_versions[-2])
|
versions_to_keep.add(local_versions[-2])
|
||||||
|
|
||||||
print(f' keeping versions for {area}: {sorted(versions_to_keep)}')
|
print(f' keeping runs for {area}: {sorted(versions_to_keep)}')
|
||||||
|
|
||||||
versions_to_remove = set(local_versions).difference(versions_to_keep)
|
versions_to_remove = set(local_versions).difference(versions_to_keep)
|
||||||
|
|
||||||
@@ -89,6 +89,6 @@ def auto_clean_btrfs():
|
|||||||
# Interesting bit: linux allows us to remove the disk image file for a mount
|
# Interesting bit: linux allows us to remove the disk image file for a mount
|
||||||
# while the mount is still being used.
|
# while the mount is still being used.
|
||||||
# We delete the disk image, update nginx config and only then unmount the /mnt dir.
|
# We delete the disk image, update nginx config and only then unmount the /mnt dir.
|
||||||
print(f' removing version for {area}: {version}')
|
print(f' removing runs for {area}: {version}')
|
||||||
version_dir = config.runs_dir / area / version
|
version_dir = config.runs_dir / area / version
|
||||||
shutil.rmtree(version_dir)
|
shutil.rmtree(version_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user