\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/yedekledb24/DatabaseBackupMasterv2/__pycache__/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/yedekledb24/DatabaseBackupMasterv2/__pycache__/storage_utils.cpython-310.pyc |
o
���g�1 � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlZdZ zd dl
ZdZ W n eyC e�
e�Ze�d� Y nw e�
e�Zdd � Zd
d� Zdd
� ZdS )� N)�datetime)�FTP)�
SMBConnectionFTz;NFS support not available - nfs4-share module not installedc C s� z�| dkrJt ||d|dd�}|du rd}|�||�}|sW dS |�� }dd � |D �} |�d
�d }
|
| vrCt�d|
� d
| � �� W dS |�� W dS | dkr�tsXt�d� W dS z't� � }t
j|dd�}|�|�}
|
�
|�}t�|� |�� t�|� W W dS ty� } zt�dt|�� �� W Y d}~W dS d}~ww | dkr�|du r�d}t� }|�||� |�||� |r�|�|� |�� W dS t�d| � �� W dS ty� } zt�d| � d|� dt|�� �� W Y d}~dS d}~ww )a�
Test connection to a storage target.
Args:
storage_type (str): Storage type (smb, nfs, ftp)
host (str): Storage host
port (int): Storage port
username (str): Username for storage
password (str): Password for storage
path (str): Storage path
Returns:
bool: True if connection successful, False otherwise
�smb�
backup-appT��use_ntlm_v2N� Fc S s g | ]}|j �qS � )�name)�.0�sharer
r
�?/var/www/html/yedekledb24/DatabaseBackupMaster/storage_utils.py�
<listcomp>9 s z+test_storage_connection.<locals>.<listcomp>�/r zShare z not found in available shares: �nfs�>NFS support is not available - nfs4-share module not installed�tcp��protozNFS connection error: �ftp� �Unsupported storage type: zStorage connection error for � �: )r �connect�
listShares�split�logger�error�close�NFS_SUPPORT�tempfile�mkdtemp�nfs4�
NFS4Client�
get_export�mount�os�listdir�umount�rmdir� Exception�strr �login�cwd�quit)�storage_type�host�port�username�password�path�conn� connected�shares�share_names�
share_name� mount_dir�client�exportr'