Jump to content

ablaty2

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by ablaty2

  1. I've never used /usr/bin/wget to run a cron. I always use the full path like this:

     

    php -q /home/byron/public_html/files/cron.php

     

    Finally, is it OK if i have many cron jobs (more than 2/day) for a short period of time while I test and debug the script?

     

    Only if your not able to test the script by clicking onto the url.

     

    I still can't get it to work. It (spurratically) sends me an email saying:

    ---------------------------

    Status: 404 Not Found

    X-Powered-By: PHP/5.3.3

    Content-type: text/html

     

    No input file specified.

    -----------------------

    First, what is the folder "files"? is it a folder on your account or do I need to have it in my URL also?

     

    Here is what I have so far for my two cron jobs:

     

    php /home/ablaty/public_html/buImg.php

     

    php /home/ablaty/public_html/buscript/buMySQL.php

     

    Both Files are viewable in the browser though

    http://geotours.heliohost.org/buImg1.php

    http://geotours.heliohost.org/buscript/buMySQL1.php

    They do take a second or 2 to load though... could it be timing out?

     

    Thanks,

    Alex

     

    Also, while I am trying to get these cron jobs to work, they seem to randomly disappear. When I try to edit one, sometimes it says: Could not find linekey=88d6b5c720cd3f10e427480ac648a9c5

  2. I would like to run a cron job that simply runs (accesses) a php webpage. I tried:

     

    /usr/bin/wget http://geotours.heliohost.org/buImg1.php >/dev/null

     

    but it doesn't seem to be working (I get no email from the cron job and nothing from the script itself). Any ideas? is /usr/bin/wget correct?

     

    Also, is there anyway to test a cron job to make sure it is working

     

    Finally, is it OK if i have many cron jobs (more than 2/day) for a short period of time while I test and debug the script?

     

    Thanks,

    Alex

  3. Thanks for posting that. Everything appears to be working when I run it (It doesn't return an errors and I receive the email with the attached .sql.gz file), but it seems like something is going wrong. When i tried to open it (with jzip and 7zip on 2 different PCs), I received an error. The .sql.gz file outputted by manually going to myPhp admin and clicking export opens fine, so I don't think it is a software problem. I tried importing the .sql.gz file using myPHP admin, but I got an error

     

    Interestingly, if I change the .sql.gz to .php and open with the browser I get a fully readable Log in to cpanel page. See attachment below

     

    Thanks again,

    Alex

  4. Yes auto backups has been disabled at the cpanel.

     

    Why don't you post your script and I'm sure somebody can show how to get around the system() function. If not I can show you how to get the source of the database gz file through curl and you can do whatever with the source you want.

     

    Here is the script. It was taken straight from http://www.theblog.ca/mysql-email-backup.

     

    I posted it here on my website.

     

    <?php
    // Create the mysql backup file
    // edit this section
    $dbhost = "yourhost"; // usually localhost
    $dbuser = "yourusername";
    $dbpass = "yourpassword";
    $dbname = "yourdb";
    $sendto = "Webmaster <webmaster@yourdomain.com>";
    $sendfrom = "Automated Backup <backup@yourdomain.com>";
    $sendsubject = "Daily Mysql Backup";
    $bodyofemail = "Here is the daily backup.";
    // don't need to edit below this section
    
    $backupfile = $dbname . date("Y-m-d") . '.sql';
    system("mysqldump -h $dbhost -u $dbuser -p$dbpass $dbname > $backupfile");
    
    // Mail the file
    
        include('Mail.php');
        include('Mail/mime.php');
    
        $message = new Mail_mime();
        $text = "$bodyofemail";
        $message->setTXTBody($text);
        $message->AddAttachment($backupfile);
            $body = $message->get();
            $extraheaders = array("From"=>"$sendfrom", "Subject"=>"$sendsubject");
            $headers = $message->headers($extraheaders);
        $mail = Mail::factory("mail");
        $mail->send("$sendto", $headers, $body);
    
    // Delete the file from your server
    unlink($backupfile);
    ?>

     

    Thanks in advance,

    Alex

  5. Thanks for the reply!

     

    Ya, I will probably end up just backing it up through cpanel. I was looking for some way to make scheduled automatic backups though, and I don't believe you can do automatic backups through cpanel.

     

  6. I found a php script to email me a backup of my mysql database. When I uploaded it and tried to run it, I got the following error

     

    Warning: system() has been disabled for security reasons

     

    Is there anyway to enable this?

     

    Thanks,

    Alex

  7. No we don't support those functions. We do have GhostScript which allows you to convert pdf files to image files.

     

    Is there any tool to create a PDF?

     

    I want to create a page that is very specifically formatted so it prints correctly

    Thanks

×
×
  • Create New...