Saturday, January 29, 2011

Cron Permission Denied

good day, I have a bash script in my home directory that works properly from the command line (file structure is default media temple DV. < noted for certain permission issues) but receive this error from cron: "/home/myFile.sh: line 2: /var/www/vhosts/domain.com/subdomains/techspatch/installation.sql: Permission denied" NOTICE: it's just line 2... it writes to the local server just fine.

Below is the Bash File:

    #!/bin/bash
mysqldump -uUSER -pPASSWORD -hHOST dbName> /var/www/vhosts/domain.com/subdomains/techspatch/installation.sql

mysql -uadmin -pPASSWORD -hlocalhost dbName< /var/www/vhosts/domain.com/subdomains/techspatch/installation.sql

can't chmod from bash (lol, yeah i tried). writing the file there and setting the permissions before the transfer is useless...

i have googled the heck out of this situation and this one still seems unique.... any insight is appreciated

  • Are there any environment variables that might be significant (maybe something MySQL pays attention to - I'm not really familiar with mySQL)? Remember that a cron job doesn't start with your environment, so you might need to define some in the bash script.

0 comments:

Post a Comment