Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Export list of files stored psysically on each drive cronjob?

Featured Replies

Hello.

 

I want to have a script that runs every night and simply outputs all the files/folders on target drives specified to a text file on a share somewhere outside of unraid. Why you may ask?

 

In the highly unlikely scenario of actual data loss i want to be able to see what was lost after the fact... It's very difficult to keep track of what data is on which drive when you have a large array and once data is gone how are you suppose to know what you lost? Knowing what data is lost mitigates the pain a lot.

 

Anyone know how i could go about doing this?

Edited by je82

Install CA User Scripts plugin first. 

 

Next look through existing scripts shared, if none match then ask if anyone has one.

 

 

  • Author

very nice thanks, looks like someone already done something like this, "Catalog Drive Contents"

  • 4 years later...

Here is a link to the "Catalog Drive Contents" script je82 probably found, for future googlers.

 

I improved it by letting it delete old lists. Here is the full script:

 

#!/bin/sh
#description=Creates an inventory tree of all mounted disks (not cache) and deletes txt files older than x days
#arrayStarted=true

SAVEPATH=/boot/config/indexTree
RETENTION_DAYS=30  # Set the number of days to keep files

# Create inventory trees for all mounted disks
for f in /mnt/disk*
do
    echo "Scanning tree for $f"
    mkdir -p $SAVEPATH/$(basename $f)
    tree -o $SAVEPATH/$(basename $f)/$(date +%Y%m%d).txt "$f"
done

# Delete .txt files older than RETENTION_DAYS
echo "Deleting .txt files older than $RETENTION_DAYS days..."
find $SAVEPATH -name "*.txt" -type f -mtime +$RETENTION_DAYS -exec rm -f {} \;

echo "indexTree complete!"
exit 0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.