Bigbruin.com
Home :: Reviews & Articles ::
Forum :: Info :: :: Facebook :: Youtube :: RSS Feed
Search  :: Register :: Log in
something like a universal chmod
Post new topic   Reply to topic    Bigbruin.com Forum Index -> Software
View previous topic :: View next topic  
Author Message
Doctor Feelgood
Arrrrghh!


Joined: 07 Apr 2003
Posts: 20349
Location: New Jersey

PostPosted: Wed, 15 Dec 2004 10:10:13    Post Subject: something like a universal chmod Reply with quote View Single Post

OK, so I have a folder where the databases are backed up to on a daily basis. But then they are overwitten each day. I just want to set up a cron similar to my other one where it copies that backup to a folder based on the day of the week, so I have 7 backups at any one time.

But, the permission seem to revert to 600 on that db backup each time it is written. I wind up manually having to change it to 777 to make sure it is accesible for copying, but is there a way I can make this happen automatically?

Grin - Thanks
Back to top
View user's profile Send private message Visit poster's website
Little Bruin
Boo Boo

Joined: 07 Apr 2003
Posts: 667
Location: Pic-A-Nic Basket
Dud3!
Forum abandoner


Joined: 21 Aug 2003
Posts: 1469
Location: Florida

PostPosted: Wed, 15 Dec 2004 11:52:13    Post Subject: Reply with quote View Single Post

just put it in your cron job, chmod 755 dir/*
_________________
Due to a not-that-interesting turn of events, I am now known as Justin Danger.
Back to top
View user's profile Send private message Visit poster's website
Doctor Feelgood
Arrrrghh!


Joined: 07 Apr 2003
Posts: 20349
Location: New Jersey

PostPosted: Wed, 15 Dec 2004 18:17:44    Post Subject: Reply with quote View Single Post

I tried that... there doesn't seem to be appropriate permissions on this level to do so. So, I logged in as root and setup a separate cron that only does that. Doesn't seem to do anything...

WTF

I now see that I can manually change permissions on this when logged into the server as root, but not when I am logged into the bigbruin area with that separate account... Confused
Back to top
View user's profile Send private message Visit poster's website
IceNine
*The Freshest*


Joined: 08 Sep 2003
Posts: 1459
Location: Bel Air

PostPosted: Wed, 15 Dec 2004 18:30:28    Post Subject: Reply with quote View Single Post

Sounds like a group problem. Try chgrp'ing it.
_________________

A letter to a soldier
Back to top
View user's profile Send private message
Doctor Feelgood
Arrrrghh!


Joined: 07 Apr 2003
Posts: 20349
Location: New Jersey

PostPosted: Wed, 15 Dec 2004 18:36:56    Post Subject: Reply with quote View Single Post

IceNine wrote:
Sounds like a group problem. Try chgrp'ing it.


can you give me some more info or an example? thanks!

Mr. T
Back to top
View user's profile Send private message Visit poster's website
IceNine
*The Freshest*


Joined: 08 Sep 2003
Posts: 1459
Location: Bel Air

PostPosted: Wed, 15 Dec 2004 18:44:11    Post Subject: Reply with quote View Single Post

Oops, sorry. I meant CHOWN:

chown -R username *

Also, I just thought of recursion in CHMOD. These files are in subdirectories, right? You might need to use the -R flag...

_________________

A letter to a soldier
Back to top
View user's profile Send private message
misty
Mmmmm... Beer


Joined: 17 Jul 2003
Posts: 737
Location: In Dr. EvilCheeze's pants

PostPosted: Wed, 15 Dec 2004 18:48:11    Post Subject: Reply with quote View Single Post

I was just going to suggest using the -R option.


If that doesn't work, who are the owner and group of the directory and the backup files.
Back to top
View user's profile Send private message Visit poster's website
Little Bruin
Boo Boo

Joined: 07 Apr 2003
Posts: 667
Location: Pic-A-Nic Basket
Doctor Feelgood
Arrrrghh!


Joined: 07 Apr 2003
Posts: 20349
Location: New Jersey

PostPosted: Wed, 15 Dec 2004 18:57:03    Post Subject: Reply with quote View Single Post

yes, files in a subdirectory.

I am unsure about ownership... the whole server is mine, so it is either my root login or the site specific one.

so... how do I use -R with chmod? just: chmod -R 777 filename

And what is that actually doing? Do I do that once, or do I need to do it as a cron?

thanks!
Back to top
View user's profile Send private message Visit poster's website
misty
Mmmmm... Beer


Joined: 17 Jul 2003
Posts: 737
Location: In Dr. EvilCheeze's pants

PostPosted: Wed, 15 Dec 2004 19:01:26    Post Subject: Reply with quote View Single Post

Copying from man pages....

the command sequence:

chmod -R 777 f*

will change permissions on:

./dir1/fdir2

./dir1/fdir2/file1

./dir1/fdir2/file2

./dir1/file3

_________________
Meg: Everybody! Guess what I am?
Stewie: Hm, the end result of a drunken back-seat grope-fest and a broken prophylactic?

Stewie: I was under the impression the name of the show was "Kids Say the Darndest Things," not "Old Black Comedians Never Shut the Hell Up."
Back to top
View user's profile Send private message Visit poster's website
thePMG
Rated XXX


Joined: 24 Apr 2004
Posts: 393
Location: Germany

PostPosted: Tue, 21 Dec 2004 21:53:38    Post Subject: Reply with quote View Single Post

I hate using chmod recursevly as it sets everything (including files) to whatever permissions you might just want on your directories, and vice versa.

This works for me:

cd /some/location && find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \;

I use it to keep things sane in my file storeage area.

_________________
It's got something to do with motherboards and fuzzy logic, f**k, I don't know...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Bigbruin.com Forum Index -> Software All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Contact Us :: On Facebook :: On Youtube :: Newsletter :: RSS Feed :: FAQ :: Links :: Sponsors :: Privacy Policy
Copyright © 2000 - 2023 Bigbruin.com - All rights reserved