Senator Posted January 6, 2006 Posted January 6, 2006 Excuse my ignorance on the matter. I have a CRON job that is set to run every day that establishes an FTP connection to a remote server and downloads a log file. This file grows on a daily basis, and I want the option of just resuming the download everyday instead of downloading the whole thing over, and over, and over again. I can run this script manually each day and it establishes the FTP connection no problem and works its magic without failure. However, if the CRON job takes a stab at it...i get a permissions failure. The problem that I think I have isolated seems to be a possible ownership issue. When I run the PHP script fron CRON it states that it cannot write the file becasue it does not have the proper access. Now, the folder that the file exists in was CHMOD'ed by myself and like I said before, it seems to work fine. My question would be getting to the end result of having my folder (which only has 1 file in it) the proper ownership/access so that this web script that Im running can have write access to make the necessary updates to the file everyday without downloading the whole file again. I dont have any knowledge of the CHOWN command or if that should even be my solution. Ive been searching around the great ol' www and cant put my thumb on my resolution (if there is one). Im left wondering if I need to contact someone at tch support to have my directory/folder have the proper permissions?? Any suggestions? Quote
Senator Posted January 6, 2006 Author Posted January 6, 2006 Excuse my ignorance on the matter. I have a CRON job that is set to run every day that establishes an FTP connection to a remote server and downloads a log file. This file grows on a daily basis, and I want the option of just resuming the download everyday instead of downloading the whole thing over, and over, and over again. I can run this script manually each day and it establishes the FTP connection no problem and works its magic without failure. However, if the CRON job takes a stab at it...i get a permissions failure. The problem that I think I have isolated seems to be a possible ownership issue. When I run the PHP script fron CRON it states that it cannot write the file becasue it does not have the proper access. Now, the folder that the file exists in was CHMOD'ed by myself and like I said before, it seems to work fine. My question would be getting to the end result of having my folder (which only has 1 file in it) the proper ownership/access so that this web script that Im running can have write access to make the necessary updates to the file everyday without downloading the whole file again. I dont have any knowledge of the CHOWN command or if that should even be my solution. Ive been searching around the great ol' www and cant put my thumb on my resolution (if there is one). Im left wondering if I need to contact someone at tch support to have my directory/folder have the proper permissions?? Any suggestions? You will have to excuse me again, im a bit brain dead with all this searching im doing. I originally meant "CHOWN" not "CHMOD"...cause I know i can CHMOD. I just saw this post in security... http://www.totalchoicehosting.com/forums/i...=24913&hl=CHOWN and know what to do now...thanks. Quote
TCH-Andy Posted January 6, 2006 Posted January 6, 2006 I'm glad you have it sorted As a note. The cron job will run as your ID, whilst a PHP from the website will run as nobody... if that makes a difference as to who you want as the owner of those directories Quote
Senator Posted January 7, 2006 Author Posted January 7, 2006 Ok, I didnt know that,but assumed. Thanks for confirming. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.