Filesystem

Create a list of directories from a config file

"""Example script for creating directories in Bash"""
import tamr_toolbox as tbox

tbox.filesystem.bash.create_directories(["/path/to/a/dir", "/path/to/different/dir"])

Clean old files recursively from a directory

"""Example script for cleaning up old files"""
from tamr_toolbox import filesystem


# to recursively delete files with a modification date older than the specified one
filesystem.bash.delete_old_files("/path/to/my/directory", num_days_to_keep=60)

# to exclude some paths underneath the top level directory
filesystem.bash.delete_old_files(
    "/path/to/my/directory", num_days_to_keep=60, exclude_paths=["save", "data/results"]
)