File manager - Edit - /home/autoph/cache/backup/backup_autoph_db.sh
Back
#!/bin/bash # MySQL database credentials DB_USER="root" DB_PASSWORD="@4u70hu36r0up007#" DB_NAME="autoph_db" # Set the current date in the format YYYY-MM-DD CURRENT_DATE=$(date +"%Y-%m-%d") # Specify the backup directory BACKUP_DIR="/home/autoph/backup" # Create the backup filename with the current date BACKUP_FILENAME="${BACKUP_DIR}/${DB_NAME}_${CURRENT_DATE}.sql" # Specify the error log file ERROR_LOG_FILE="${BACKUP_DIR}/error.log" # Run mysqldump command and redirect stderr to the error log file mysqldump -u"${DB_USER}" -p"${DB_PASSWORD}" "${DB_NAME}" > "${BACKUP_FILENAME}" 2> "${ERROR_LOG_FILE}" # Check if the mysqldump command was successful if [ $? -eq 0 ]; then echo "Backup completed successfully. File: ${BACKUP_FILENAME}" else echo "Backup failed. Check the error log file for more information: ${ERROR_LOG_FILE}" fi
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings