Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-05-2007, 02:28 PM   #1
LQ Newbie
Registered: Sep 2007
Posts: 4

Rep: Reputation: 0
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?

Old 12-06-2007, 12:47 AM   #2
Senior Member
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing file permission, How to edit a file? rainchild Linux - Newbie 8 01-14-2007 10:18 PM
change file permission of a mouse device file permanently alexandre_fs Linux - General 5 01-09-2007 06:30 AM
Retain old status raylhm LQ Suggestions & Feedback 9 11-15-2006 12:28 PM
Retain original squid.conf file ALInux Linux - Networking 1 06-02-2006 10:16 PM
Vi - retain position in file between invokations of vi Xanadu Linux - Software 1 12-23-2004 02:33 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration