NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
ghdweb
Nov 25, 2008Aspirant
Moving files between shares
I'm moving files around on my ready nas, having setup backup jobs to copy all my data from an external USB drive to my shares. Problem is, it's shockingly slow, taking hours to move folders of a few...
CharlesLaCour
Sep 28, 2009Aspirant
If you have enabled ssh as root to the NAS you can use a find command to move the files. Since you want the final destination in the same directory that we will be searching we will for simplicity have a temporary directory to move the files to outside of the directory being searched. In your example you want all of the the jpg, jpeg, tif and tiff files found under the "/Archive" directory moved to the directory "/Archive/NewDirectory". Since this is on a ReadyNAS I will assume that the "/Archive" directory is under a share named backup. To avoid having to actually having to copy the contents of the files we want to move the files on the same mounted volume. Unless you have done a custom volume setup you will have a directory off of "/" named "c" which is the x-raid volume where your the directories for the shares are located. The full path to the Archive directory under the backup share would be "/c/backup/Archive".
WARNING: The use of find to execute any command that modifies files/directories if done wrong can have catastrophic results so be careful if you are going to use this.
First we make the temporary directory:
Now we move the files into the temporary directory:
Now we move the files from the temporary directory to their final destination:
Now to clean up by removing the temporary directory:
This should be very fast since there is no actual copy of the file content being done, the file entry is just being modified to have it in the new location.
WARNING: The use of find to execute any command that modifies files/directories if done wrong can have catastrophic results so be careful if you are going to use this.
First we make the temporary directory:
mkdir /c/backup/TempArchive
Now we move the files into the temporary directory:
find /c/backup/Archive/ -iname \*.jpg -exec mv '{}' /c/backup/NewArchive \;
find /c/backup/Archive/ -iname \*.jpeg -exec mv '{}' /c/backup/NewArchive \;
find /c/backup/Archive/ -iname \*.tif -exec mv '{}' /c/backup/NewArchive \;
find /c/backup/Archive/ -iname \*.tiff -exec mv '{}' /c/backup/NewArchive \; Now we move the files from the temporary directory to their final destination:
mv /c/backup/TempArchive/* /c/backup/Archive/NewDirectory
Now to clean up by removing the temporary directory:
rmdir /c/backup/TempArchive
This should be very fast since there is no actual copy of the file content being done, the file entry is just being modified to have it in the new location.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!