This is a Bash script you can use on your Unraid server to check the array for Apple temporary files (commonly named ._*
and .DS_Store
) and delete them. Save the script to a file (e.g., clean_apple_temp_files.sh
) and run it from your terminal.
-
Save the Script: Save the script as
clean_apple_temp_files.sh
in a location accessible from your Unraid server. -
Make the Script Executable: Run the following command to make the script executable:
chmod +x clean_apple_temp_files.sh
-
Run the Script: Execute the script with:
./clean_apple_temp_files.sh
-
Schedule via Cron (Optional): To run this script automatically at regular intervals, you can add it to your Unraid server's
cron
jobs:crontab -e
Add the following line to run the script daily (adjust the schedule as needed):
0 2 * * * /path/to/clean_apple_temp_files.sh
- Scans the array directories (
/mnt/disk*
and/mnt/user
) for Apple temporary files (._*
and.DS_Store
). - Deletes any matches while providing a verbose output for logging purposes.
Note: This script only deletes these specific temporary files. Ensure you test it first to avoid unintended file deletion.