Dear all,
I have two datasets with slightly different data in it, so I need to diff the difference between them but I only want to copy the diff which is in folderA to a third location for human inspection ;-)
Eg. I have two folders with a lot of subfolders files in it: folderA and FolderB
diff -qr folderA folderB
superimportantfile.pdf. Only in FolderA
etc.
After a while I found and tested a nice way to do this, but this does only works on debian based linux because the cp option -t is not implemented on bsd....
diff -rq folderA folderB | sed -n "s/^Only in \(folderA\): \(.*\)/'\1\/\2'/p" | xargs cp -rtv folderC
Of course I could fire up debian mount folderA folderB and folderC via cifs to run this but due to the amount of data I prefer to run this directly on the truenas box.
Does Anybody has an idea to achieve this on Truenas ?
I have two datasets with slightly different data in it, so I need to diff the difference between them but I only want to copy the diff which is in folderA to a third location for human inspection ;-)
Eg. I have two folders with a lot of subfolders files in it: folderA and FolderB
diff -qr folderA folderB
superimportantfile.pdf. Only in FolderA
etc.
After a while I found and tested a nice way to do this, but this does only works on debian based linux because the cp option -t is not implemented on bsd....
diff -rq folderA folderB | sed -n "s/^Only in \(folderA\): \(.*\)/'\1\/\2'/p" | xargs cp -rtv folderC
Of course I could fire up debian mount folderA folderB and folderC via cifs to run this but due to the amount of data I prefer to run this directly on the truenas box.
Does Anybody has an idea to achieve this on Truenas ?
Last edited: