• GoDaddy Community
  • Managed WordPress Hosting
  • Managed WordPress Hosting

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 

    Poboy (poorboy) Managed website backup

    This is a script to backup your website files.

     

    You have to get the complete path using filezilla and ftt

     

    Create a directory in your file manager webroot; add the following php script to the directory.

     

    Create a schedule with cron job manager to run the script on you chosen schedule.

     

    <?php

    //Copy the website directory and its contents

    $source_dir = '/home/content/.../html/dir/';
    $dest_dir ='/home/content/.../_wp_backups/dir_'.date('G_a_m_d_y');

    if (!file_exists($dest_dir)) {
    mkdir($dest_dir, 0777, true);
    }

    if (is_dir($source_dir)) {
    echo "source exists\r\n";
    shell_exec("cp -r $source_dir $dest_dir");
    echo "copy complete";
    }


    ?>

     

    Enjoy this New Orleans style script