December 6, 201411 yr Greetings all. I was wondering if there's a command that will generate a file list for a specific drive that I can save to a txt file. I have unfortunately suffered a parity drive failure, which in of itself wouldn't be too much of an issue as I had a warm spare ready to go. However, it appears that I have another hard drive that is throwing up massive errors and the parity rebuild averages at less that 1GB/Sec. As that would take about 3 weeks to rebuild it, as well as various freezups and other issues while it's running it's not feasible. So, it's mostly media stuff that I can redownload if that drive fails it's just a matter of a lot of work/time to replace not irreplacable stuff. I have a new drive being shipped to me, so I'm hoping my dying drive will last until it's installed and precleared. Then I can copy it's contents, swap it for the good drive and rebuild the parity drive properly. Having said that, if it doesn't last and dies before then I was hoping to generate a list of what I'm going to lose before it happens if possible. Anyone know a command line that will take care of that? Cheers, hlid.
December 6, 201411 yr "ls -R /mnt/disk1 > /mnt/user/share/list.txt" Change the disk number and destination path as needed.
December 7, 201411 yr Here are some find commands, suitable for running in a cron table. It creates cr\lf delimited files so you can load them in notepad. after creating them you can move them to your flash for save keeping off the ramdrive or store them on the cache drive. i.e. mv /var/log/filelist.disk3.txt /boot/log This version uses the full path in the output. root@unRAID: find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%h/%f\r\n" Example: root@unRAID: # head /var/log/filelist.disk3.txt /mnt/disk3/disk3.gdbmsums /mnt/disk3/Music/bin/check_scan.sh /mnt/disk3/Music/bin/mkdirs.sh /mnt/disk3/Music/bin/rsync.sh /mnt/disk3/Music/bin/rsync_stereo.sh /mnt/disk3/Music/bin/rsync_media.sh /mnt/disk3/Music/bin/20_rsync_stereo_media /mnt/disk3/Music/bin/mkbig_dirs.sh This version deletes the source argument (/mnt/disk3) from the output and writes it as a dos.txt file. Example: root@unRAID: # find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%P\r\n" root@unRAID: # head /var/log/filelist.disk3.txt disk3.gdbmsums Music/bin/check_scan.sh Music/bin/mkdirs.sh Music/bin/rsync.sh Music/bin/rsync_stereo.sh Music/bin/rsync_media.sh Music/bin/20_rsync_stereo_media Music/bin/mkbig_dirs.sh Music/bin/mk1000.sh Music/tmp/MommasLittleHelper.mpg To make it a unix delimited file take out the \r. To make it suitable for piping into xargs change the \r\n to \0 These filelists are usefile for greping if they are all stored in a globable location ie. grep fileIWanToFind /var/log/filelist.disk*.txt If you need the full ls output you can change it to find /mnt/disk3 -type f -ls > /var/log/filelist.disk3.txt Which is similar to ls -lR
December 7, 201411 yr Here are some find commands, suitable for running in a cron table. It creates cr\lf delimited files so you can load them in notepad. after creating them you can move them to your flash for save keeping off the ramdrive or store them on the cache drive. i.e. mv /var/log/filelist.disk3.txt /boot/log This version uses the full path in the output. root@unRAID: find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%h/%f\r\n" Example: root@unRAID: # head /var/log/filelist.disk3.txt /mnt/disk3/disk3.gdbmsums /mnt/disk3/Music/bin/check_scan.sh /mnt/disk3/Music/bin/mkdirs.sh /mnt/disk3/Music/bin/rsync.sh /mnt/disk3/Music/bin/rsync_stereo.sh /mnt/disk3/Music/bin/rsync_media.sh /mnt/disk3/Music/bin/20_rsync_stereo_media /mnt/disk3/Music/bin/mkbig_dirs.sh This version deletes the source argument (/mnt/disk3) from the output and writes it as a dos.txt file. Example: root@unRAID: # find /mnt/disk3 -type f -fprintf /var/log/filelist.disk3.txt "%P\r\n" root@unRAID: # head /var/log/filelist.disk3.txt disk3.gdbmsums Music/bin/check_scan.sh Music/bin/mkdirs.sh Music/bin/rsync.sh Music/bin/rsync_stereo.sh Music/bin/rsync_media.sh Music/bin/20_rsync_stereo_media Music/bin/mkbig_dirs.sh Music/bin/mk1000.sh Music/tmp/MommasLittleHelper.mpg To make it a unix delimited file take out the \r. To make it suitable for piping into xargs change the \r\n to \0 These filelists are usefile for greping if they are all stored in a globable location ie. grep fileIWanToFind /var/log/filelist.disk*.txt If you need the full ls output you can change it to find /mnt/disk3 -type f -ls > /var/log/filelist.disk3.txt Which is similar to ls -lR Wow, nice info Weebo, thanks! Saved for future reference
December 7, 201411 yr I should add that I 'usually' create a filelist.txt file of very disk every night and put it in a filedb directory on each disk. [ -d /mnt/disk3/filedb ] && mkdir -p /mnt/disk3/filedb find /mnt/disk3 -type f -fprintf /mnt/disk3/filedb/disk3.filelist.txt "%h/%f\r\n" this lets me do a quick grep across the whole array with grep fileiwantofind /mnt/disk*/filedb/disk*.filelist.txt or utilize the user share with grep fileiwanttofind /mnt/user/filedb/disk*.filelist.txt My preference has always been to have a filelist.txt in the root of each directory so I could do it simpler grep fileiwantofind /mnt/disk*/filelist.txt However that makes it harder to see all of the filelists in one user share, or archive offline. I may set it up for symlinks in the future. Point of having the filedb usershare is for other types of files such as md5sums and gdbm files I use for rapid indexing.
Archived
This topic is now archived and is closed to further replies.