def make_backup(module_id):
	""" Function: Move the directory to  a backup location
	"""
	backup_location = config.find_location_for_module(module_id, 'backup_location') 
	stage_location = config.find_location_for_module(module_id, 'stage_location') 
	logger.info("["+module_id+"] Moving files " + stage_location + " to " + backup_location )
	try:
		if os.path.exists(backup_location):
			shutil.rmtree( backup_location, True )
		else:
			#This is to ensure that backup folder's path exists
			#and this path is reachable
			os.makedirs(backup_location)
			shutil.rmtree(backup_location, True )			
		if os.path.exists(stage_location):	
			shutil.move( stage_location , backup_location)
		else:
			logger.info("Location " + stage_location + " not present, no backup taken")
	except:
		logger.error("[" + module_id + "] Failed to remove:" + backup_location)
		logger.error("[" + module_id + "] Failed to remove Error:" + str(sys.exc_info()[0])+ " " + str(sys.exc_info()[1]))
		raise 
	else:
		os.makedirs(stage_location)
 Function: Move the directory to  a backup location
	
recipes/Python/302592_Threaded_FTP_Client/recipe-302592.py