LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-23-2008, 04:30 PM   #1
WingnutOne
Member
 
Registered: Sep 2007
Location: Kansas City
Distribution: Mixed, mostly RH / Fedora
Posts: 76

Rep: Reputation: 16
Question Undo a chmod command?


I need to undo a recursive [chmod o-w] command that I ran on my /var/www directory. Is there any way to accomplish this?
I'm hoping that somewhere, the system actually kept track of which of the hundreds of files required changes and which didn't. Any help would be appreciated.

Thanks,
wn

PS: I did make a backup. It's corrupted.
 
Old 06-23-2008, 04:43 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
nope, sorry. you'd need to chmod o+w whatever is relevant in turn.
 
Old 06-23-2008, 04:44 PM   #3
pezdspencer
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Rep: Reputation: 0
There isn't really a way you can undo that. Recursive options to commands are very dangerous, as you just found out. :-/

However, it depends on what is in your directory. If it is all installed via RPMs, you might be able to use the rpm's --setguids and --setperms options. But since you said it was your www directory, I'm going to assume that alot of data was not from rpm.

Can you at least list out the contents of your backup? This might help you in terms of at least knowing what the original permissions are.
 
Old 06-23-2008, 05:20 PM   #4
WingnutOne
Member
 
Registered: Sep 2007
Location: Kansas City
Distribution: Mixed, mostly RH / Fedora
Posts: 76

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by pezdspencer View Post
Can you at least list out the contents of your backup? This might help you in terms of at least knowing what the original permissions are.
Yeah, I have a list of what they were before. But there's hundreds of them! Just didn't want to do them all manually if there was another option. (That's why I used the recursive in the first place.) Oh well. Ya don't always get what you want. :shrug:

Thanks anyway!

Last edited by WingnutOne; 06-23-2008 at 05:21 PM. Reason: sp
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do undo MV or RM command? pogromca Linux - Newbie 8 11-26-2013 06:25 AM
To undo a given bash-command HULLU Linux - Newbie 6 02-21-2010 10:06 PM
chmod command manoj.linux Solaris / OpenSolaris 6 12-08-2007 01:21 PM
How do I undo last command executed? Elfking Linux - General 4 02-05-2004 01:18 AM
How to undo 'chmod u+s `which kppp`' bdika Linux - General 3 08-29-2003 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:28 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