Problem running cleanup.sh

DaveO

Joined: 2002-11-05
Posts: 22
Posted: Fri, 2010-04-30 05:22


Gallery version (not just "2"):2.3.1 core 1.3.0.1
PHP version (e.g. 5.1.6): 5.2.6 cgi-fcgi
PHPInfo Link (see FAQ):
Webserver (e.g. Apache 1.3.33): Apache (System Info gave no version #)
Database (e.g. MySql 5.0.32): mysql 5.1.39-log, lock.system=flock
Activated toolkits (e.g. NetPbm, GD): ArchiveUpload, ImageMagick, NetPBM, Ffmpeg
Operating system (e.g. Linux): Linux redbull 2.6.31.5-modsign-aufs2-grsec-2-opt
Browser (e.g. Firefox 2.0): Firefox 3.5

I upgraded my Gallery to 2.3.1 a few days ago. Sometime during the upgrade, a message popped up about removing a bunch of files no longer needed in the 'gallery2' directory. I downloaded the 'cleanup.sh' file - to be used later.

I could not follow the suggested directions for running 'cleanup.sh' - specifically I could not find the "yoursite.com/gallery2" folder in my web browser. The suggested way to run it was posted by cdjutil on 2-20-09.

So I used Putty to login to the redbull server (Dreamhost hosts my gallery site) and run the cleanup.sh file which I downloaded during the upgrade. I got an error the first time I ran it, and someone told me I needed to give the file the 'execute' permission. I did that, and the file ran the next time I ran it, but I got a "cannot remove . . . Permission denied" error on every file it tried to remove.

Do I need to change the permissions of each file that the 'cleanup.sh' file is trying to remove? I hope not.

Suggestions, please.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-04-30 20:49

The permissions on the files it's trying to remove are probably owned by the web server user or they are "locked" down so they couldn't be overwritten

Yes, to run that script yourself you'll need to change permissions on all the files.

From PuTTY, change directories to your modules directory (as it's probably trying to clean up some files under that directory)

Type ls -al Take a screen shot or copy the output and post that here.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2010-04-30 20:58

This might help as well:
http://gallery.menalto.com/node/83751#comment-301257
running cleamup.sh from PuTTY you are running as a different user than the webserver so that might help as it has others.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
DaveO

Joined: 2002-11-05
Posts: 22
Posted: Sat, 2010-05-01 03:04

Floridave,

That link is the one I mentioned in my 2nd paragraph. As far as I can see, it doesn't use Putty. It says to use a browser to go to the yoursite.com/gallery2 folder and (I guess) the cleanup.php file runs automatically.

What I cannot figure out is how you browse to that URL, because the gallery2 folder is at the root of my dreamhost server. When I use that URL with the browser, I get a Not Found error.

1) Can you tell me how to browse to that URL? According to the other posts for that problem, that would run the cleanup.sh file and solve my problem.

2) If the 'browser' method works, does it work because when the browser is running, the web server is running the cleanup.sh file (via the cleanup.php file), therefore the files can be removed because the owner is removing them?

Thanks.

PS - I didn't post to that other because it's over a year old.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2010-05-01 04:28
Quote:
That link is the one I mentioned in my 2nd paragraph.

How can I know? There is 10 of thousands of posts in the forums And I don't see a link.

Quote:
1) Can you tell me how to browse to that URL?

Where did you put the file?

Quote:
2) If the 'browser' method works, does it work because when the browser is running, the web server is running the cleanup.sh file (via the cleanup.php file), therefore the files can be removed because the owner is removing them?

It works because the browser asks the webserver to run the program. The webserver (user) owns the files and therefore has proper permissions.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
DaveO

Joined: 2002-11-05
Posts: 22
Posted: Sat, 2010-05-01 06:10

Floridave,

My error. What I should have said instead of "That link is the one I mentioned in my 2nd paragraph." is "The link which you put in your first response is the one I mentioned in my 2nd paragraph." I found that same posting (by cdjutil on 2-20-09) before I posted my questions.

I tried following its directions, but line #5 ("open web browser and go to yoursite.com/gallery2/cleanup.php") doesn't work. I get a "Not Found" error when I try to go to that URL in my browser - both Firefox and IE. That's why I tried using Putty to run the cleanup file.

Thanks for explaining why I'm having a problem running it as myself with Putty - it's a permissions problem. I'm not the owner of the files that the cleanup file is trying to remove.

I put the cleanup.sh and the cleanup.php files in the 'gallery2' folder, just as suggested by the posting.

The main question remains - how do I get to the required URL so the browser can run the PHP file? When I go to either http://gallery.gpdave.net/gallery2/cleanup.php or http://gpdave.net/gallery2/cleanup.php - as specified in line #5 of the directions I get the Not Found error.

I guess I'm doing something wrong because the other people used those directions said they were able to remove the unneeded files.

Suggestions??

Thanks.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-05-01 08:21
Quote:
It says to use a browser to go to the yoursite.com/gallery2 folder and (I guess) the cleanup.php file runs automatically.

What I cannot figure out is how you browse to that URL, because the gallery2 folder is at the root of my dreamhost server. When I use that URL with the browser, I get a Not Found error.

Quote:
I tried following its directions, but line #5 ("open web browser and go to yoursite.com/gallery2/cleanup.php") doesn't work. I get a "Not Found" error when I try to go to that URL in my browser - both Firefox and IE. That's why I tried using Putty to run the cleanup file.

These two are not the same.

If you get a 404 error (not found) then either you've put the file in the wrong directory, or you're using the wrong path, or the wrong filename.

If the cleanup.php file is in the root of your website then it's "yourdomain.com/cleanup.php"

 
DaveO

Joined: 2002-11-05
Posts: 22
Posted: Sun, 2010-05-02 04:47

Alecmyers,

Thanks for the input. Even though I really don't think the 'cleanup.php' file is in the root directory, I ran it from there - as per your last line - from my browser. It apparently ran, but removed only 3 of the 40+ files in 'cleanup.sh'.

I'm spending way too much time on this, trying to save a little disk space. So, here's one last question:

Could I be having problems because I ran the Gallery upgrade from the Dreamhost Control Panel (one of their 'one-click' upgrades) instead of downloading the upgrade and running it myself? (Even though the 'cleanup.sh' file was offered during the Dreamhost-run upgrade?) Or should how I ran the upgrade not matter?

Thanks.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2010-05-02 05:06
Quote:
I'm spending way too much time on this, trying to save a little disk space.

I agree. Just ignore them :)

And yes, installing via a host's one-click installer can cause these sorts of issues if they didn't take the time to write a few lines of code in their control panel for any files created through those installers to be owned by your account.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here