From 28787c7659b3a5b9cf9cfb2fa6b1563a168bdbc8 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Fri, 1 Aug 2025 09:32:03 +0500 Subject: Add script to create CACHEDIR.TAG file Useful to mark directory as a cache for other tools (ex. restic). --- cache-tag-this-dir | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 cache-tag-this-dir diff --git a/cache-tag-this-dir b/cache-tag-this-dir new file mode 100755 index 0000000..0dad1c8 --- /dev/null +++ b/cache-tag-this-dir @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +TAG_FILE_NAME=CACHEDIR.TAG + +if [ -f "$TAG_FILE_NAME" ]; then + echo "File $TAG_FILE_NAME already exists, skipping any action." +else + COMMENT="user $USER" + cat <"$TAG_FILE_NAME" +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by $COMMENT. +# For information about cache directory tags, see: https://bford.info/cachedir/ +EOF +fi -- cgit v1.2.3