This guide shows how to move files smaller than 10MB from your array (disk1) to your cache drive. It helps when you use Jellyfin, Emby or Plex and want small metadata files, subtitles or NFOs on faster storage. My media files are stored in /mnt/user/share_media/media.
- Time
- 3 min
- Steps
- 4
- Updated
- 19 Nov 2026
You will learn
- The Command
- Command Breakdown
- Advanced Options & Best Practices
- Important Notes for Unraid Users
Step 1 of 4: The Command
To move all files smaller than 10MB while logging the output to a specific file, use the following command:
Bash
nohup rsync -avz --remove-source-files --ignore-existing --max-size=10m --itemize-changes /mnt/disk1/share_media/media/ /mnt/cache/share_media/media/ > /mnt/user/debug/smallfiles.txt 2>&1 &
Step 2 of 4: Command Breakdown
nohup ... &: This wraps the command to ensure it runs in the background. It will continue executing even if you close your terminal or lose your SSH connection.rsync -avz:-a(archive): Preserves permissions, symlinks, and timestamps.-v(verbose): Provides detailed output.-z(compress): Compresses data during transfer (useful if moving over a network, though optional for local disk-to-disk).
--remove-source-files: This effectively turns the “copy” into a “move” by deleting the files from the source only after a successful transfer.--ignore-existing: Ensures that files already present at the destination are skipped and not overwritten.--max-size=10m: The core filter. It instructs rsync to only process files that are 10MB or smaller.--itemize-changes: Provides a detailed list of exactly what is happening to each file (e.g., if it’s being created or skipped)./mnt/disk1/...to/mnt/cache/...: Your source and destination paths.> /mnt/user/debug/smallfiles.txt 2>&1: Redirects both standard output and error messages to your log file for later review.
Step 3 of 4: Advanced Options & Best Practices
1. Perform a “Dry Run” First
Before committing to a move, do a test run first. It shows you exactly which files would be moved without actually changing anything.
Command:
Bash
rsync -avz --dry-run --ignore-existing --max-size=10m --itemize-changes /mnt/disk1/share_media/media/ /mnt/cache/share_media/media/
2. Real-time Log Monitoring
Since the main command runs in the background, you can monitor its progress in real-time by “tailing” the log file:
Command:
Bash
tail -f /mnt/user/debug/smallfiles.txt
3. Dealing with Empty Directories
The --remove-source-files flag removes files, but it often leaves behind empty folder structures on the source disk. If you want to clean up empty directories on disk1 after the move, you can run:
Command:
Bash
find /mnt/disk1/share_media/media/ -type d -empty -delete
4. Verification
After the process completes, you can verify the number of small files remaining on the source with this command:
Bash
find /mnt/disk1/share_media/media/ -type f -size -10M | wc -l
If the result is 0, all targeted files have been successfully moved.
Step 4 of 4: Important Notes for Unraid Users
[!CAUTION] Path Awareness: Ensure you are moving files between specific disks (
/mnt/disk1/to/mnt/cache/) rather than through the user share path (/mnt/user/) when performing large manual moves. This avoids the “User Share Copy Bug” and ensures you know exactly where the data is landing.Unraid 7 Compatibility: This command uses standard Linux binaries included in Unraid 7.2.0 beta and above.
