diff options
author | doc <doc@filenotfound.org> | 2025-06-30 20:11:52 +0000 |
---|---|---|
committer | doc <doc@filenotfound.org> | 2025-06-30 20:11:52 +0000 |
commit | 41e897f4945aaf8fbcdf0b12ac2f08c5e6ae0458 (patch) | |
tree | db7c3520fd91abc3cf56b1a52095d23f3a80d059 /perms.sh |
Diffstat (limited to 'perms.sh')
-rwxr-xr-x | perms.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/perms.sh b/perms.sh new file mode 100755 index 0000000..30ba756 --- /dev/null +++ b/perms.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Safe and resumable chmod script with progress output + +TARGET_DIR="/mnt/raid5" +LOGFILE="$HOME/chmod_resume_$(date '+%Y%m%d-%H%M').log" +INTERVAL=500 + +echo "🔧 Starting permission normalization on $TARGET_DIR" +echo "Logging to $LOGFILE" +echo "Started at $(date)" >> "$LOGFILE" + +i=0 +find "$TARGET_DIR" -type d -not -perm -005 | while read -r dir; do + chmod o+X "$dir" + echo "✔️ $dir" >> "$LOGFILE" + ((i++)) + if ((i % INTERVAL == 0)); then + echo "⏳ Processed $i directories so far..." + fi +done + +echo "✅ Completed at $(date)" >> "$LOGFILE" +echo "✅ chmod finished. Total: $i directories." |