Web browser and backup

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
bugmenot
Posts: 34
Joined: Tue Feb 10, 2015 2:23 pm

Web browser and backup

Post by bugmenot »

What is lightest and best web browser when i run ZoneMinder in Raspberry 3 B?

Is this really easiest way to backup db, just db not images etc? I'm not sure how to run this code.
viewtopic.php?f=32&t=23815#p91360

Code: Select all

#!/bin/bash

# Path to the tools this scripts needs
MYSQLDUMP="/usr/bin/mysqldump"
GZIP="/bin/gzip"
FIND="/usr/bin/find"

# Check to see if this script has access to all the commands it needs
for CMD in $MYSQLDUMP $GZIP $FIND; do
  type $CMD &> /dev/null

  if [ $? -ne 0 ]; then
    echo
    echo "ERROR: The script cannot find the required command \"${CMD}\"."
    echo
    exit 1
  fi
done

# Enter SQL database login credentials
USER="root"
PASS="mypass"

# Specify which databases to backup
DB="--all-databases"

# Specify where the databases will be saved to
BKUP_PATH="/path/to/your/backup/folder"

# Format for the timestamp
timestamp="$(date +%Y-%m-%d_%a)"

# Run the backup and compress it
error=0
${MYSQLDUMP} -u${USER} -p${PASS} --events --single-transaction --quick ${DB} | ${GZIP} -9 > ${BKUP_PATH}/Nightly_dB_Backup_${timestamp}.sql.gz

if [ "$?" -ne 0 ]; then
	echo
	echo "WARNING: Mysqldump returned an error!"
	echo
	error=1
fi

# Now find & delete old backups we no longer need
${FIND} ${BKUP_PATH} -maxdepth 1 -type f -mtime +30 -delete

if [ "$?" -ne 0 ]; then
	echo
	echo "WARNING: Find returned an error!"
	echo
	error=1
fi

if [ "$error" -eq 0 ]; then
	echo "Mysql backup script completed successfully!"
fi
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Web browser and backup

Post by kitkat »

bugmenot wrote: Thu Jul 11, 2019 5:11 pm Is this really easiest way to backup db, just db not images etc? I'm not sure how to run this code.
Maybe, but this will work...

Code: Select all

mysqldump -u zoneminder -p --opt zm > zoneminder_backup.sql
Enter the zoneminder database user's password when prompted.

To skip the prompt, such as for automated cron jobs, use the -p parameter...

Code: Select all

mysqldump -u zoneminder -p mYp455w0rd --opt zm > zoneminder_backup.sql
bugmenot
Posts: 34
Joined: Tue Feb 10, 2015 2:23 pm

Re: Web browser and backup

Post by bugmenot »

I get this error. I enabled opt_use_auth and maybe it causes it.

Code: Select all

mysqldump: got error: 1698: “access denied for user ‘zoneuser’@‘localhost’” when trying to connect
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Web browser and backup

Post by kitkat »

bugmenot wrote: Fri Jul 12, 2019 4:12 am I get this error. I enabled opt_use_auth and maybe it causes it.

Code: Select all

mysqldump: got error: 1698: “access denied for user ‘zoneuser’@‘localhost’” when trying to connect
I get the same if I use the username and password from /etc/zm/zm.conf, but the credentials in /etc/zm/conf.d/db-user.conf work.

'OP_USE_AUTH' is a ZM thing and won't affect MySQL or MariaDB.
bugmenot
Posts: 34
Joined: Tue Feb 10, 2015 2:23 pm

Re: Web browser and backup

Post by bugmenot »

sudo nano /etc/zm/conf.d/db-user.conf shows empty file.
bugmenot
Posts: 34
Joined: Tue Feb 10, 2015 2:23 pm

Re: Web browser and backup

Post by bugmenot »

I still get this same error:

Code: Select all

mysqldump: got error: 1698: “access denied for user ‘zoneuser’@‘localhost’” when trying to connect
Post Reply