()
Dump entire database on server and backup to local.
Dump entire database on server and backup to local.
Dump entire database on server and backup to local .
def backup():
    '''
    Dump entire database on server and backup to local.
    '''
    dt = _now()
    f = 'backup-awesome-%s.sql' % dt
    with cd('/tmp'):
        run('mysqldump --user=%s --password=%s --skip-opt --add-drop-table --default-character-set=utf8 --quick awesome > %s' % (db_user, db_password, f))
        run('tar -czvf %s.tar.gz %s' % (f, f))
        get('%s.tar.gz' % f, '%s/backup/' % _current_path())
        run('rm -f %s' % f)
        run('rm -f %s.tar.gz' % f)
def backup ( ) : dt = _now ( ) f = 'backup-awesome-%s.sql' % dt with cd ( '/tmp' ) : run ( 'mysqldump --user=%s --password=%s --skip-opt --add-drop-table --default-character-set=utf8 --quick awesome > %s' % ( db_user , db_password , f ) ) run ( 'tar -czvf %s.tar.gz %s' % ( f , f ) ) get ( '%s.tar.gz' % f , '%s/backup/' % _current_path ( ) ) run ( 'rm -f %s' % f ) run ( 'rm -f %s.tar.gz' % f )