LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   retain file permission (https://www.linuxquestions.org/questions/linux-newbie-8/retain-file-permission-604750/)

lightpace 12-05-2007 02:28 PM

retain file permission
 
if i am copying files through a shell script from serverA to serverB using SFTP, how would i make sure that the files when copied over would have 644 as file permission. i have already setup umask to 022, made sure that the source and target shells are same but when the files got copied over they have 640 as file permissions; btw it works fine with FTP, only causing issues with SFTP.

can someone help?

thanks
Mark

ehawk 12-06-2007 12:47 AM

http://www.derkeiler.com/Newsgroups/...4-05/0252.html

for sftp2:

get [-p] [--overwrite] [-I] [-W] [-c] [--force-lower-case] [file ...]

Transfers the specified files from the remote end to the local end. Directories are recursively copied with their contents.

If -p,--preserve-attributes is given, sftp tries to retain permissions and timestamps.

I am told this also works for sftp -p


All times are GMT -5. The time now is 01:49 AM.