Jump to content

Recommended Posts

Posted (edited)

Hello all,

 

I need some help with my configuration of automysqlbackup.sh. It was working fine for several months until just a few weeks ago, and now it is giving me this error:

 

>/bin/sh: /home/[site directory]/public_html/automysqlbackup.sh: /bin/bash
: bad interpreter: No such file or directory

 

It is set to run every night at midnight, and last night it didn't run at all.

 

here is the configuration portion of the file:

 

># Username to access the MySQL server e.g. dbuser
USERNAME=[my username]

# Username to access the MySQL server e.g. password
PASSWORD=[my password]

# Host name (or IP address) of MySQL server e.g localhost
DBHOST=localhost

# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
DBNAMES="db_name_1 db_name_2 db_name_3"

# Backup directory location e.g /backups
BACKUPDIR="/home/[site directory]/backups"

# Mail setup
# What would you like to be mailed to you?
# - log   : send only log file
# - files : send log file and sql files as attachments (see docs)
# - stdout : will simply output the log to the screen if run manually.
# - quiet : Only send logs if an error occurs to the MAILADDR.
MAILCONTENT="log"

# Set the maximum allowed email size in k. (4000 = approx 5MB email [see docs])
MAXATTSIZE="4000"

# Email Address to send mail to? (user@domain.com)
MAILADDR="[my email address]"


# ============================================================
# === ADVANCED OPTIONS ( Read the doc's below for details )===
#=============================================================

# List of DBBNAMES for Monthly Backups.
MDBNAMES="mysql $DBNAMES"

# List of DBNAMES to EXLUCDE if DBNAMES are set to all (must be in " quotes)
DBEXCLUDE=""

# Include CREATE DATABASE in backup?
CREATE_DATABASE=yes

# Separate backup directory and file for each DB? (yes or no)
SEPDIR=yes

# Which day do you want weekly backups? (1 to 7 where 1 is Monday)
DOWEEKLY=6

# Choose Compression type. (gzip or bzip2)
COMP=gzip

# Compress communications between backup server and MySQL server?
COMMCOMP=no

# Additionally keep a copy of the most recent backup in a seperate directory.
LATEST=no

#  The maximum size of the buffer for client/server communication. e.g. 16MB (maximum is 1GB)
MAX_ALLOWED_PACKET=

#  For connections to localhost. Sometimes the Unix socket file must be specified.
SOCKET=

# Command to run before backups (uncomment to use)
#PREBACKUP="/etc/mysql-backup-pre"

# Command run after backups (uncomment to use)
#POSTBACKUP="/etc/mysql-backup-post"

 

Anyone have any suggestions?

 

note:

I don't have it set to 'all' databases b/c I was getting backups of every db on the server, even those that aren't mine. Do I need to put commas in between each db name in the DBNAMES array?

 

TIA

Edited by programthisweb
Posted

also, here is the command I am using to run the cron job

 

>/home/[username]/scripts/automysqlbackup.sh.2.5

 

note: i've tried moving the file outside my public_html directory into a scripts directory. it has CHMOD 777, as does the file.

Posted

I don't know why your script stopped working, but

in the config file

 

# Backup directory location e.g /backups

BACKUPDIR="/home/[site directory]/backups"

 

make sure you put your cpanel name after /home/

 

# Backup directory location e.g /backups

BACKUPDIR="/home/cpanelname/[site directory]/backups"

 

unless that is what you mean by [site directory]

 

 

Maybe delete the cron job and create it again.

Posted
# Backup directory location e.g /backups

BACKUPDIR="/home/[site directory]/backups"

 

make sure you put your cpanel name after /home/

 

# Backup directory location e.g /backups

BACKUPDIR="/home/cpanelname/[site directory]/backups"

 

unless that is what you mean by [site directory]

Maybe delete the cron job and create it again.

 

Thanks Don, yes that is what I mean by [site directory] - I couldn't think of "cpanel username" when I was writing this post. I have deleted the cron job several times and tried again to no avail. I am at a loss here.

Posted

I have sent in 3 separate help tickets, and each time the tech will run the backup, say it is working fine, and that's it. Still, the cron doesn't work. Could something be wrong with the cron system itself on server 97?

  • 2 weeks later...
Posted
also, here is the command I am using to run the cron job

 

>/home/[username]/scripts/automysqlbackup.sh.2.5

 

note: i've tried moving the file outside my public_html directory into a scripts directory. it has CHMOD 777, as does the file.

Try changing the file name to just automysqlbackup.sh

mine is in the root folder ( /home/cpanelname/)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...