Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
YABB upgrades - setting persmissions (Read 7078 times)
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
YABB upgrades - setting persmissions
Jan 25th, 2009 at 1:54am
 
Rad,

Saw the post on your blog today about the new perl program that helps you set the permissions on the YABB files after you extract them for an upgrade.  Glad to hear you got some help scripting it and don't have to do it manually.

I did notice that you said you use the command 'tar -zxf' to untar the files, and it is supposed to preserve permissions but it doesn't.  In fact, that exact command is NOT supposed to preserve permissions.  You are using the tar command with the z,x, and f flags.  Here is a quick explanation of the flags:

-x, --extract, --get
             extract files from an archive
-f, --file [HOSTNAME:]F
             use archive file or device F (default "-", meaning stdin/stdout)
-z, --gzip, --ungzip
             filter the archive through gzip

This is directly from the tar man page.  In english, it means that x extracts the files from the tar archive (rather than 'c', which would put regular files *into* an archive).  'f' tells tar to extract a tar file, rather than acting on standard input, as it was originally designed.  The 'z' flag tells tar to uncompress the files using the gzip process (which you can tell you need by the '.gz' at the end of the filename.)

One flag you aren't passing but should be if you want to preserve permissions is 'p':

-p, --same-permissions, --preserve-permissions
             extract all protection information

Without the 'p' flag, it will create all files using the user you are logged in as and the system default permissions.  With 'p', it should use the permissions from the original file, which you want.   Another useful flag is 'v', for verbose.  This allows you to see what tar is doing as it does it.  So, the full new command would be:

'tar -zxfvp YABBfilename.tar.gz'

If you don't like all the text that scrolls by as tar does it's work, take the 'v' back off.  Also, the flags can be in any order you want (for the most part.)

Type 'man tar' at a linux command prompt to see all this information and more.

On a personal note, I would have PM'd this to you but I thought sharing it here might help anyone else if they had the same issue.
 
WWW  
IP Logged
 

Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: YABB upgrades - setting persmissions
Reply #1 - Jan 25th, 2009 at 1:39pm
 
Yes, that is cool.

I am smiling .. especially about the -p part.

I ran 'round this tree at the YaBB forums, and some of their 'gurus' looked at the problem (including the switches I was using), but nobody saw anything wrong.

I will try/use the new switches during the next upgrade. I am pretty stoked .. cuz setting them manually suk'ed majorly, as you might imagine.

This is so cool.  Cool
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: YABB upgrades - setting persmissions
Reply #2 - Jan 25th, 2009 at 4:20pm
 
Rad wrote on Jan 25th, 2009 at 1:39pm:
I ran 'round this tree at the YaBB forums, and some of their 'gurus' looked at the problem (including the switches I was using), but nobody saw anything wrong.

It seems like you've assembled a good group in your forums, since you were able to get help resolving the issue in multiple ways on your own site when YABB guys couldn't come through.

I'm especially suprised that no one suggested scripting it.  It's pretty standard to script anything that is 1. tedius and 2. repetitive or has to be done multiple times.  Perl is a great language for scripting.  

One other tidbit that might be helpful in the future - I'm not sure if you realise that chmod and chown can operate on multiple files at a time.  Something like 'chmod 766 file1 file2 file3' should work just fine.  You can also use the -R flag to change the permissions on all subdirectories recursively (for ex. 'chmod 766 -R file1 file2 ...')  chown has similar features. 

Hopefully the -p flag on tar or the perl script will work for you, as they are both better solutions than doing it manually, even if you can do multiple files at once.  I just thought I'd mention it in case you ever have to modify several files in the future.

Anyway, good luck with the next upgrade.  Let us know what works / what doesn't.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: YABB upgrades - setting persmissions
Reply #3 - Jan 26th, 2009 at 12:10am
 
Okay, here are some weird (unexplainable) results:

if i run the command you suggested: tar -zxfvp YABBfilename.tar.gz

i get error:
tar: vp: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: YaBB_2.3.1.tar.gz: Not found in archive
tar: Error exit delayed from previous errors

I can see file there, so I know it's there. So I repeated everything, double-checking everything .. with same results.

Then I tried leaving off -v

so tar -zxfp...

and got similar error:

tar: p: Cannot open: No such file or directory (notice no 'v' listed)

everything else same as above error msg.

Then I tried original tar -xzf...

.. and it worked fine.

Go figure. I submitted sppt tik to WiredTree. Maybe they know why it won't run with -p switch. This is outta my league.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: YABB upgrades - setting persmissions
Reply #4 - Jan 26th, 2009 at 12:57am
 
Update.

Had to put the -f last.

this worked: tar -xzpvf...

many of the perms are correct, tho some are not what their install guide say they should be.
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: YABB upgrades - setting persmissions
Reply #5 - Jan 26th, 2009 at 10:39pm
 
HaHa sorry about that.  That makes sense tho.  Whatever is after the -f is the file tar will operate on, so 'tar -zxfvp' told it to operate on the file 'vp'.  Glad you figured it out.
 
WWW  
IP Logged
 

Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: YABB upgrades - setting persmissions
Reply #6 - Jan 27th, 2009 at 11:27am
 
MrMagoo wrote on Jan 26th, 2009 at 10:39pm:
Glad you figured it out.

WiredTree tech sppt.
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: YABB upgrades - setting persmissions
Reply #7 - Jan 27th, 2009 at 2:52pm
 
Rad wrote on Jan 27th, 2009 at 11:27am:
WiredTree tech sppt.

They are infinitely patient.  Seems like a good compay.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: YABB upgrades - setting persmissions
Reply #8 - Jan 27th, 2009 at 6:00pm
 
MrMagoo wrote on Jan 27th, 2009 at 2:52pm:
They are infinitely patient.

Smiley You don't know how right you are.
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print