Backup script help

Discussion in 'Domains, Hosting and Servers' started by lucasbytegenius, May 28, 2011.

  1. lucasbytegenius

    lucasbytegenius Regular Member

    Joined:
    May 8, 2011
    Messages:
    256
    Likes Received:
    50
    Alright, so I don't know if this is in the right section, but I'm pretty sure it is.
    Anyway, I need some help with this backup script I'm trying to use, what it's supposed to do is run the backup system, and then upload the file via FTP to another server. However, the email I get keeps saying "Unexpected $end on line 41". Maybe you guys can help:
    PHP:
    <?php

    // PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server.
    // This script contains passwords. KEEP ACCESS TO THIS FILE SECURE! (place it in your home dir, not /www/)

    // ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED *********

    // Info required for cPanel access
    $cpuser "hidden"// Username used to login to CPanel
    $cppass "hidden"// Password used to login to CPanel
    $domain "enigmachs.com"// Domain name where CPanel is run
    $skin "HG"// Set to cPanel skin you use (script won't work if it doesn't match). Most people run the default x theme

    // Info required for FTP host
    $ftpuser "hidden"// Username for FTP account
    $ftppass "hidden"// Password for FTP account
    $ftphost "hidden"// Full hostname or IP address for FTP host
    $ftpmode "passiveftp"// FTP mode ("ftp" for active, "passiveftp" for passive)

    // Notification information
    $notifyemail "hidden"// Email address to send results

    // Secure or non-secure mode
    $secure 0// Set to 1 for SSL (requires SSL support), otherwise will use standard HTTP

    // Set to 1 to have web page result appear in your cron log
    $debug 0;

    // *********** NO CONFIGURATION ITEMS BELOW THIS LINE *********

    if ($secure) {
    $url "ssl://".$domain;
    $port 2083;
    } else {
    $url $domain;
    $port 2082;
    }

    $socket fsockopen($url,$port);
    if (!
    $socket) { echo "Failed to open socket connection
    $>
    Truth is I'm not good at all with php, but can diagnose it a little bit. I'd appreciate any help I can get.
     
  2. SpacewardAsh

    SpacewardAsh Lurking From Space

    Joined:
    Jan 2, 2011
    Messages:
    211
    Likes Received:
    683
    Location:
    Falmouth, Cornwall, UK
    First Name:
    Ashley
    line 41 appears to be the last line (the closing php tag) and I can immedately see it's wrong because it should be
    PHP:
    ?>
    and not
    PHP:
    $>
    also
    PHP:
    if (!$socket) { echo "Failed to open socket connection
    should probably be something like
    PHP:
    if (!$socket) { echo "Failed to open socket connection" };
    but don't take my word on it because my php skills are very limited.

    Your best bet is to ask for support from where ever you got the script ;)
     
    Kaiser likes this.
  3. lucasbytegenius

    lucasbytegenius Regular Member

    Joined:
    May 8, 2011
    Messages:
    256
    Likes Received:
    50
    Ok well I think I fixed it, no more error emails, but I'm not getting any success emails either and there's no files in the remote directory.
    I got the script from a long-dead forum somewhere and I haven't been able to get support there.

    Now I need help getting it to work. I keep setting the cron to run a few minutes ahead of my current time and I've waited a hour or two.
     
  4. SpacewardAsh

    SpacewardAsh Lurking From Space

    Joined:
    Jan 2, 2011
    Messages:
    211
    Likes Received:
    683
    Location:
    Falmouth, Cornwall, UK
    First Name:
    Ashley
    Unless there is anyone else here who knows PHP well enough to help you out, I suggest you go ask the author of the script for support if it's not working correctly ;)
     
Similar Threads
Loading...

Share This Page