centos6 - how can i move a lot of files on centos from one directory to another? -


i have been trying move lot of files on centos 6, 1 directory another; talking thousands of .wav recordings fill 230 gb.

i use crontab it, , have command:

find /var/spool/asterisk/backups/ -name ".wav" -exec mv /usr/src/scripts/ {} \

the question want use cp first instead of mv see how works, doesn't make anything, how know if 1 above mv works?

if it's not many files

mv /var/spool/asterisk/backups/*.wav /usr/src/scripts/ 

if have huge amount of files fail long command line , "find" can take forever since moves files 1 @ time (and in case wrong way, src dest not dest src)

you can use like

find /var/spool/asterisk/backups/ -name "*.wav"|xargs -n 100 mv --target-directory=/usr/src/scripts/ 

then move 100 files @ time, should speed things little.

to see can prefix "echo" in "echo mv ...|head" , copy&paste 1 line output.

to test little can use "cp -a" instead of mv


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -