I googled this and I can only find how to preserve the permissions, but not how to actually set them.
Here's my situation, I have my main server which has a samba share and I code off of that. The code is actually tested on a separate server. Rather then make another separate samba share off that server I rather keep everything central. The problem is, when I rsync the code over to the server, it just goes as whatever permissions it wants. Typically, root. I can preserve permissions, but it's just going to end up being random based on whatever that uid and guid happens to be on that server.
My script just does a chown -R and chmod -R to fix the permissions but this just seems dirty, because it has to run through every single file each time.
Here's my situation, I have my main server which has a samba share and I code off of that. The code is actually tested on a separate server. Rather then make another separate samba share off that server I rather keep everything central. The problem is, when I rsync the code over to the server, it just goes as whatever permissions it wants. Typically, root. I can preserve permissions, but it's just going to end up being random based on whatever that uid and guid happens to be on that server.
My script just does a chown -R and chmod -R to fix the permissions but this just seems dirty, because it has to run through every single file each time.