LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-05-2007, 02:28 PM   #1
lightpace
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?

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

Rep: Reputation: 48
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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:18 PM.

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