LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 11-30-2012, 01:41 AM   #1
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
Retain same permissions with wget


Hi,

How can I Retain the same permissions with wget a file from ftp server.
 
Old 11-30-2012, 12:05 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
It would be better to use rsync or scp to copy files and permissions. The ftp list command will show the remote directory contents on systems that support it, but you would have to script something to parse the '.listing' file that wget retrieves and apply it to the files after the download.
 
Old 12-01-2012, 05:53 AM   #3
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Also, if you want to use wget, you preserve the permissions by creating a tar archive of the file(s) first.

man tar:

Quote:
-p, --preserve-permissions
extract information about file permissions (default for superuser)
 
  


Reply


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
Does mv retain permissions pgb205 Linux - Newbie 5 08-09-2015 12:34 PM
How to resume an interrupted wget using wget.log? misterJ Linux - Software 2 06-19-2011 02:21 PM
How to retain .bashrc file? tulsi Linux - Newbie 3 09-08-2009 06:31 PM
Retain variables in C kalimat Programming 10 05-27-2009 02:36 AM
Retain old status raylhm LQ Suggestions & Feedback 9 11-15-2006 01:28 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration