<?php
include("config_attrans.php");
require('Dropbox/Dropbox.php');
$date 			        = date('Y-m-d');
$local 					= $config['db_clone']['local'];
$live 					= $config['db_clone']['dropbox_path'];
$path['local_path']  	= $local . '/' . $date . '/';
$path['live_path']   	= $live;
$dropbox_key 			= $config['db_clone']['dropbox_key'];
$dropbox        		= new Dropbox($dropbox_key);
$file_name      		= date('Y-m-d') . '.sql';
$target_file    		= $path['local_path'] . $file_name;
//$new_dest       = $path['local_path'] . 'uploaded/' . $file_name;
if( file_exists($target_file) ) {
	$destination        = $path['live_path'] . $file_name;
	$status             = $dropbox->files->upload($destination, $target_file, "overwrite");
} else {
    die('File Does Not Exits !!');
}

?>