Пример #1
0
    os.path.abspath(os.path.join(os.path.dirname(__file__),
	os.path.pardir)))

from models.local import Local

def strip_wp_grep(result):
    if type(result) is list:
        result = result[0]
    result = result.split(", '")[1]
    result = result.split("'")[0]
    return result

local = Local()
local.cd('~/webapps')

directories = local.c('ls').split("\n")

for site in directories:
    try:
        local.cd('~/webapps/'+site)
        is_wordpress = local.c('ls wp-config.php') == 'wp-config.php'

        if is_wordpress:
            # Upgrade wordpress
            local.c("php ~/MoveIt/misc/wordpress_upgrade.php")

            # Upgrade plugins
            upgrade = local.c("php ~/MoveIt/misc/plugin_restore.php")

            # Upgrade themes
            upgrade = local.c("php ~/MoveIt/misc/theme_upgrade.php")
Пример #2
0
from models.local import Local


def strip_wp_grep(result):
    if type(result) is list:
        result = result[0]
    result = result.split(", '")[1]
    result = result.split("'")[0]
    return result


local = Local()
local.cd('~/webapps')

directories = local.c('ls').split("\n")

for site in directories:
    try:
        local.cd('~/webapps/' + site)
        is_wordpress = local.c('ls wp-config.php') == 'wp-config.php'

        if is_wordpress:
            # Upgrade wordpress
            local.c("php ~/MoveIt/misc/wordpress_upgrade.php")

            # Upgrade plugins
            upgrade = local.c("php ~/MoveIt/misc/plugin_restore.php")

            # Upgrade themes
            upgrade = local.c("php ~/MoveIt/misc/theme_upgrade.php")
Пример #3
0
    result = result.split(", '")[1]
    result = result.split("'")[0]
    return result


local = Local()
local.cd('~/webapps')

try:
    type_of_backup = sys.argv[1]
except:
    type_of_backup = 'daily'

directory = '~/backup/' + type_of_backup + '/'

directories = local.c('ls').split("\n")

output = ''

for site in directories:

    try:
        local.cd('~/webapps/' + site)
        backup = directory + site + '.tar.bz2'

        is_wordpress = local.c('ls wp-config.php') == 'wp-config.php'

        if is_wordpress:
            password = strip_wp_grep(local.c('grep DB_PASSWORD wp-config.php'))
            user = strip_wp_grep(local.c('grep DB_USER wp-config.php'))
Пример #4
0
        result = result[0]
    result = result.split(", '")[1]
    result = result.split("'")[0]
    return result

local = Local()
local.cd('~/webapps')

try:
    type_of_backup = sys.argv[1]
except:
    type_of_backup = 'daily'

directory = '~/backup/'+type_of_backup+'/'

directories = local.c('ls').split("\n")

output = ''

for site in directories:

    try:
        local.cd('~/webapps/'+site)
        backup = directory+site+'.tar.bz2'

        is_wordpress = local.c('ls wp-config.php') == 'wp-config.php'

        if is_wordpress:
            password = strip_wp_grep( local.c('grep DB_PASSWORD wp-config.php') )
            user = strip_wp_grep( local.c('grep DB_USER wp-config.php') )