HOW TO: Automated database backups (1 line of code + cPanel)
#51
I just noticed I had the wrong information in there the whole time. Nothing should be uploaded below the public_html directory in regards to this tutorial. I have fixed my mistake now and 755 is perfectly secure. I don't think your cron will work like that because it will try executing the cron job as a PHP script and not a bash script. Sad
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#52
(2010-01-06, 09:46 PM)KuJoe Wrote: I just noticed I had the wrong information in there the whole time. Nothing should be uploaded below the public_html directory in regards to this tutorial. I have fixed my mistake now and 755 is perfectly secure. I don't think your cron will work like that because it will try executing the cron job as a PHP script and not a bash script. Sad

Argh no!!!
I can't remove it...
But I'll try and report back.
I'll ask the host.
[Image: 468x602b.png]
Reply
#53
Question 
Ok, what am I doing wrong here? I'm not getting any emails/error messages. I first thought I had the server time wrong so I set it to run every few minutes to test...still nothing. Username and DB name are the same...is that a prob?

/usr/bin/mysqldump -hlocalhost -umyname_mybb -pxxxxxxxxxx myname_mybb | gzip > /home/myname/dbbackup/mybb.sql.gz

File is named crondb, removed .txt extension. Script is CHMOD to 755, dbbackup folder is CHMOD to 666

Path to script is
/home/myname/crondb

Hosting is shared on SharkSpace, with cPanel ver. 11.25.0-RELEASE.
OS Linux, theme x3, MySQL version 5.0.89-community, Apache version 2.2.14, cPanel Pro 1.0 (RC1)
Reply
#54
Can you try to chmod the dbbackup folder to 755? I've encountered a few weird shared hosting servers where 666 didn't work for some reason.
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#55
Okay, just tried this myself...

/usr/bin/mysqldump -hlocalhost -umyname_forum -pxxxxxxxxxxxx myname_db | gzip > /home/myname/backups/lasthourlybackup.sql.gz

file named hourlybackup, no .txt extention, CHMOD 755 though much of this should be unneeded information in a minute

path
/home/myname/hourlybackup

In ran, but here's what I got via email
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help
/home/myname/hourlybackup: line 1: [Q: command not found
/home/myname/hourlybackup: line 1: /home/myname/backups/lasthourlybackup.sql.gz: No such file or directory

Figured the last line of that was my own stupidity (not creating the directory), so I have created the directory and it is CHMOD 755 now. What about "[Q: command not found" though?
Reply
#56
Very strange. I have no idea where that "[Q:" is coming from. From the message it looks like the problem is with one of the options. Does your username, password, or forum have a "Q" or symbols in it by chance?
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#57
Yes, it did. In fact it had "[Q" in it (password generator), and I hadn't thought to look at that before. I created another account (with access to the database) with a dangerously simple password for testing purposes. It looks like it worked, but it stopped notifying me (?). I suppose if the password was the problem it's not too hard to fix (though it might be worth noting as some password generators will use that and other characters).
Reply
#58
It's only supposed to notify you if there is some form of output (such as an error). If you want an e-mail each time it is run add a second line with something like the following:
echo "Database Backup Complete."
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#59
Nah, I don't need a notification each time it completes...just wanted to make sure that wasn't a sign of another problem. Looks like all's well now. Thanks.
Reply
#60
That was weird about the password issue though. I normally use randomly generated passwords for my backup accounts, I guess I will keep that in mind next time I create one. Smile And the fact that you don't get an e-mail is a good thing, you're probably like me and only want to be notified when there is a problem. Wink
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)