1

On my old server, I would create a sub domain and set a cron task up for a file on that sub domain. The cron created a text file it used as a lock file to make sure it didn't run 2 at the same time (the cron checks if its running every 5 mins). This was working great.

Now I have moved to the new server, I create my subdomain and set up the cron task BUT the script doesn't have permission to create the text file now. All I want is for that text file to be created successfully without having to give write access specifically like it used to but I can't see what the problem is.

I am running CentOS with Plesk. I was running CPanel (should have kept it :( )

The error I get now is Access denied for user 'apache'@'localhost' (using password: NO)

Can someone help me understand what I need to do.

2
  • Are you sure that's not 2 error messages? The Access denied ... bit looks like a MySQL error message to me. What user/group is the cron job running as? What are the permissions/ownership of the directory that you want to create the lock file in?
    – user9517
    Jun 5, 2011 at 16:57
  • To be honest I don't know what user / group the script runs as :( I know on my old server it ran as the domain user but this one seems a little different. How can I check? With regards to the error, sorry, the first part is mine. Will remove for clarity.
    – webnoob
    Jun 5, 2011 at 16:59

1 Answer 1

0

I got around this by creating one folder with 0777 permissions that I store all my lock files. If someone gains access, no worries.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .