Jump to content

Problem Setting Up Cron Job


Miriam

Recommended Posts

I have configured the dbsender.php script with the top line of #! /usr/bin/php -q as per the instructions within the script.

 

I have set up the cron job as:

php -q /home/USERNAME/dbsender/dbsender.php >dev/null based on info from other threads.

 

I'm requesting the file to be sent by email.

 

I'm receiving an email that says:

/bin/sh: dev/null: No such file or directory

 

I have uploaded the script above html_public into a directory called dbsender.

I have chmoded the dbsender directory to 770 and the dbsender.php file to 770.

 

Any help will be appreciated.

 

Thanks

Link to comment
Share on other sites

I use dbsender and here's how I have mine configured.

 

I did not add the #! /usr/bin/php -q to the top of the file as you did.

 

My dbsender folder is 770, the script itself is 644

 

My cron command is:

>/use/bin/php -q /home/USERNAME/dbsender/dbsender.php

 

 

I'm now receiving two emails, one says the database file has been backed up and is attached, and the other contains this message:

 

sh: /dbsender/fDATABASE_NAME-113005-0253pm.sql: No such file or directory

tar: DATABASE_NAME-113005-0253pm.sql: Cannot stat: No such file or directory

tar: Error exit delayed from previous errors

sh: ncftpput: command not found

 

The file attachment is actually empty.

 

Any ideas what's wrong?

 

Thanks

Link to comment
Share on other sites

Are you trying to use FTP? I am sending via email.

 

Check also to make sure you configure the following variables correctly.

 

>// configure your database variables below:
$dbhost = 'localhost'; // Server address of your MySQL Server
$dbuser = 'cpanelname_user-for-db'; // Username to access MySQL database
$dbpass = 'password-for-database-user'; // Password to access MySQL database
$dbname = 'cpanelname_databasename'; // Database Name

Link to comment
Share on other sites

Are you trying to use FTP? I am sending via email.

 

Check also to make sure you configure the following variables correctly.

 

>// configure your database variables below:
$dbhost = 'localhost'; // Server address of your MySQL Server
$dbuser = 'cpanelname_user-for-db'; // Username to access MySQL database
$dbpass = 'password-for-database-user'; // Password to access MySQL database
$dbname = 'cpanelname_databasename'; // Database Name

 

 

I'm trying to send via email.

 

I have checked the configuration, and I think I have it correct, as you have shown, with both the cpanelname as the prefix then an underscore, then the actual database/user name.

 

Do you have any idea why it can't actually write anything to the file?

 

Miriam

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...