Skip to content

Instantly share code, notes, and snippets.

@JoaoVagner
Created February 25, 2013 18:53
Show Gist options
  • Save JoaoVagner/5032238 to your computer and use it in GitHub Desktop.
Save JoaoVagner/5032238 to your computer and use it in GitHub Desktop.
FUELPHP Mongo TASK backup
<?php
namespace Fuel\Tasks;
class Mongo {
public function run() {
$file = \Fuel\Core\Config::load('db');
$env = $file['mongo']['default']['hostname'];
exec('cd fuel/app/backup/ && mongodump --journal --host ' . $env . ' --port 27017 && tar -zcvf backup_'.date('Y-m-d-h-m-s').'.tar.gz dump && rm -rf dump;');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment