If you have a billion files in a directory, anything you try to do accessing a file in that directory is going to take a LONG time. In this case you have to read the directory twice for each file found that is less than 48 hours old. You said you're copying files, but there is nothing in the command line you listed that will copy anything. The command line you gave will search for groups of names of files that have been modified within the last 48 hours and then read the directory again for each group to print the names of those files.
The time needed to run this pipeline would probably be cut in half (while producing the same results except that the order in which the files are printed may be different) if you used the command:
instead of the command:
Note that if a lot of files have been changed in the last two days, neither of these will give you a sorted list of the files that have changed.
Note also that if any filenames in the file hierarchy rooted in the current directory contain a space, tab, or newline character, the command you have using xargs will fail, and the output from the replacement command I suggested may be ambiguous.
I need to copy about 13 Tb of data from one directory and subdirectories to the other (another mount point). If I run this as a cron, say between 10 pm and 7 am, not all of the files will be copied over. Is there a way of 'resuming' the copy the following evenings until all files are copied over? (0 Replies)
Hi
when copy the files from one directory to another as like below,it is tried to copy *. as a file.
cp /home/rha/*.
My objective is to copy all the files (don't care about case sensitive),
Thanks in advance for your valuable reply. (1 Reply)
Hi Everybody,
I am Unable to view files in a particular directory under /opt. But, when I reboot the server, I am able to view the files.. Its happening daily. Do u 've n e answers/suggestions.
Kindly help..
:confused: (1 Reply)
Hi Everybody,
I am Unable to view files in a particular directory under /opt. But, when I reboot the server, I am able to view the files.. Its happening daily. Do u 've n e answers/suggestions.
Kindly help..
:eek: (1 Reply)
Iam in the process of copying a directory with thousands of directories and files into a new directory.
I need to preserve permissions, owner, group, date and timestamps, everything.
Iam using AIX and would need help of writing the command whether it is cp-RP or cpio.
Apprecaite your... (3 Replies)
Dear All,
Again I have another simple question. :confused:
I want to write a csh which can copy all files of a current directory with a new name in the same directory, I mean:
If I have tree bird apple as files in a directory I want to give ,say number 007 as argument to my csh and it copies... (3 Replies)
I have a folder will a lot of documents (pdf, xls, doc etc.) which users have uploaded but only 20% of them are currently linking from my html files. So my goal is to copy only the files which are linked in my html files from my Document directory into another directory.
Eg: My documents exist... (5 Replies)
How to copy files from one directory to another directory with the subfolders copied.
If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*.
I do not want to create sub folders in folder2.
Can copy command create them automatically?
I tried cp -a and cp -R but did... (4 Replies)
Hi
I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.).
Pls advise how can I do that.
Thanks (17 Replies)
Hi have a system running solaris with a mount point running 58% capacity used, but unfortunately when I type ls -lrtin a specific directory, it returns: ls: Not enough space. I suspect there are millions of files in this directory.
So what I did is to create a script like this:
touch -mt... (13 Replies)