I want to copy a folder from my X-Serve RAID to an external HDD on an X-Serve. Both disks are on the same server, so copying is fairly easy. I use the ditto command:
ditto -rsrc /Volumes/WadXServeRaid/Users/ $destinationpath/Users/
However, I only want the copy to start if there is enough space on the destination disk. I know I can use the DU
command to assess the destination disk but I don't know how to get the file size of a folder and compare it to the destination space.
Any suggestions would be hugely appreciated!