agurk = 'agurk4.agurk.dk' agurkuser = '******' backupsdir = '/home/rkupv/drush-backups' keyfile = os.path.normpath('D:/rkupv/Google/Home/Data/peter/Codes/PuTTY/PuTTYprivateForOpenssh.ppk') mysqluser = '******' mysqlpw = 'LarsMarianne' drush = os.path.normpath('C:/Users/rkupv/AppData/Roaming/Composer/vendor/drush/drush/drush.bat') # Get desired site name while True: site = input("Please type Web sitename, either lillan or gretel1:\n") site=site.strip() if site in ('lillan', 'gretel1'): break msu = MovesiteUtils() # Connect msu.connect(agurk, agurkuser, keyfile) # Get filename shells = "cd drush-backups;ls -t | " + "grep " + site + " | sed 1q | head -c -1" stdin, stdout, stderr = msu.ssh.exec_command(shells) output = stdout.read() archivename = output.decode("utf-8") # Get file if needed restoredir = os.path.normpath(place + '/' + archivename) restoreto = os.path.normpath(place + '/' + site) if not os.path.exists(restoredir):
agurkuser = '******' backupsdir = '/home/rkupv/drush-backups' keyfile = os.path.normpath('/home/rkupv/.ssh/id_rsa') mysqluser = '******' mysqlpw = 'LarsMarianne' drush = os.path.normpath('/usr/bin/drush') usergroup = 'rkupv:www-data' # Get desired site name while True: site = input("Please type Web sitename, either lillan or gretel1:\n") site=site.strip() if site in ('lillan', 'gretel1'): break msu = MovesiteUtils() # Connect msu.connect(agurk, agurkuser, keyfile) # Get filename shells = "cd drush-backups;ls -t | " + "grep " + site + " | sed 1q | head -c -1" stdin, stdout, stderr = msu.ssh.exec_command(shells) output = stdout.read() archivename = output.decode("utf-8") # Get file if needed restoredir = os.path.normpath(place + '/' + archivename) restoreto = os.path.normpath(place + '/' + site) if not os.path.exists(restoredir):