Skip to content

Commit

Permalink
fmu_copy_revision - Delete ert log files
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe committed Nov 21, 2024
1 parent 8acb488 commit e2f1947
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/scripts/fmu_copy_revision.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Copying Profiles

By default some file types and directories will be skipped. Here are some profiles:

#. Copy everything
#. Copy everything, except:
1. Copy everything
2. Copy everything, except:

* Directories with name ``backup``
* Directories with name ``users``
Expand All @@ -24,13 +24,15 @@ By default some file types and directories will be skipped. Here are some profil
* Files ending with ~
* Empty folders (except those listed above) will be kept

#. Copy everything, except:
3. Copy everything, except:

* All folders and files mentioned in option 2
* The following folders under ``ert/`` (if they exist):

* ``output``
* ``ert/*/storage``, including ``ert/storage`` (for backward compatibility)
* ``ert/model/``
* ``ert/model/logs``, including ``ert/output/log`` (for backward compatibility)

* The following folders or files under ``rms/`` (if they exist):

Expand All @@ -51,15 +53,15 @@ By default some file types and directories will be skipped. Here are some profil

* Empty folders (at destination) except those listed above will kept

#. As profile 3, but also all empty folder (at destination) will removed. This the DEFAULT profile!
#. As profile 3, but keeps more data:
4. As profile 3, but also all empty folder (at destination) will removed. This the DEFAULT profile!
5. As profile 3, but keeps more data:

* Folders and files ``rms/output`` will be kept
* Folders and files ``share/results`` and share/templates will be kept.

#. Only copy the ``<coviz>`` folder (if present), which shall be under ``<revision>/share/coviz``:
6. Only copy the ``<coviz>`` folder (if present), which shall be under ``<revision>/share/coviz``:

* Symbolic links will be kept, if possible

#. Make your own filter rules in a named file.
7. Make your own filter rules in a named file.

3 changes: 3 additions & 0 deletions src/subscript/fmu_copy_revision/fmu_copy_revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
- ert/output/**
- ert/storage/**
- ert/output/storage/**
- ert/model/logs/**
- ert/output/log/**
- input/seismic/**
- rms/model/*.log
- rms/output/**
Expand All @@ -138,6 +140,7 @@
- ert/output/
- ert/storage/
- ert/**/storage/
- ert/model/logs/
- rms/input/seismic/
- share/results/
- share/templates/
Expand Down
8 changes: 8 additions & 0 deletions tests/test_fmu_copy_revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"somefolder/any.backup",
"somefolder/anybackup99.txt",
"somefolder/attic/any.txt",
"ert/model/test.ert",
"ert/model/logs/log.txt",
"ert/output/log/another_log.txt",
]


Expand Down Expand Up @@ -148,6 +151,9 @@ def test_rsync_profile3(datatree):
assert not (datatree / target / "rms" / "input" / "faults" / "x.dat").exists()
assert not (datatree / target / "backup").is_dir()

assert not (datatree / target / "ert" / "model" / "logs").is_dir()
assert not (datatree / target / "ert" / "output" / "log").is_dir()


def test_rsync_profile4(datatree):
"""Testing vs filter profile 4."""
Expand Down Expand Up @@ -176,6 +182,8 @@ def test_rsync_profile4(datatree):
assert not (datatree / target / "rms" / "input" / "faults" / "x.dat").exists()
assert not (datatree / target / "backup").is_dir()

assert datatree / target / "ert" / "model" / ""


@pytest.mark.parametrize(
"rmsinputperm, profile",
Expand Down

0 comments on commit e2f1947

Please sign in to comment.